Wednesday, August 20, 2008

Scripting registry changes - technique

5 Types of technique in scripting registry change
A brief Description

1. INF
a. Also known as Setup Information files
b. With the .inf extension
c. Able to add, change, and delete registry values
d. difficulty level for INF is medium
e. It is easy to install, just right click on it and select install
f. example of INF file


HKLM, Software\Microsoft\Windows\CurrentVersion\Run,,,"myprogram"

HKCU, Software\Microsoft\Windows\CurrentVersion\Run

2. REG
a. has the .reg extension
b. it is the easiest way to add, modify, or delete registry
c. example
Windows Registry Editor Version 5.00

"avgnt"="\"C:\\Program Files\\Avira\\AntiVir PersonalEdition Classic\\avgnt.exe\" /min"
"Acrobat Assistant 8.0"="\"C:\\Program Files\\Adobe\\Acrobat 8.0\\Acrobat\\Acrotray.exe\""
"Zone Labs Client"="C:\\Program Files\\Zone Labs\\ZoneAlarm\\zlclient.exe"
"chkpendrive"="c:\\chkpendrive\\chkpendrive.exe c:\\chkpendrive\\chk.txt"
"LanSpeed2"="C:\\Program Files\\LanSpeed2\\LanSpeed2.exe"





3. Batch
a. has the extension of .bat
b. Example
@echo off
Reg delete %HKCV%\Explorer\MenuOrder /f

4. Script
a. You can either use VBscript or JScript to change(Windows support both)
b. example (VBScript)
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKCU\Software\testing\",1,"REG_BINARY"
c. Example (JScript) * Case sensitive
var WshShell = WScript.CreateObject("WScript.Shell");


5. MSI
a. MSI stands for Windows Installer Packages.
b. This is just like normal installer such as Microsoft Office and so on.
c. Needs to be compile only can be used.
d. Needs more higher level scripting and programming skills