Misc Windows Settings

Copy files to the computer at login

copy “\serverinstallvpnlogonLoginVPN.*” “C:Documents and SettingsAll UsersStart-meny”

Starting application in new window (in this case installing trend antivirus)

shell “%COMSPEC% /c start /SEPARATE \serverofcscanautopcc”

Reading from registry

$Key = ReadValue (“HKEY_CURRENT_USERSoftwareFolder”,”Key”)

IF $OTLK<>0
   ;Do This
ENDIF

Copy Files to Desktop at logon with versioncontrol

$ASCOP = ReadValue (“HKEY_CURRENT_USERSoftwareSysteam”,”ASCOP”)

IF $ASCOP<>3
   Shell “%comspec% /c Copy \servershare*.* c:folder”
   WriteValue(“HKEY_CURRENT_USERSoftwareSysteam”,”ASCOP”, “3”, “REG_SZ”)
ENDIF

Logoff Users At First Login

$USROFF = ReadValue (“HKEY_CURRENT_USERSoftwareSysteam”,”USROFF”)

IF $USROFF<>2
   $RC = LogOff(1) 
   WriteValue(“HKEY_CURRENT_USERSoftwareSysteam”,”USROFF”, “2”, “REG_SZ”)
ENDIF

Setup Folder Redirection

; My Documents

$result=AddKey(“HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders”)
$result=WriteValue(“HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders”,”Personal”, “\serverUsers%USERNAME%”,”REG_EXPAND_SZ”)

; Desktop

if EXIST (“\server%USERNAME%desktop”) GOTO DESKTOP
 MD \server%USERNAME%desktop
ENDIF

:DESKTOP
$result=AddKey(“HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders”)
$result=WriteValue(“HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders”,”Desktop”, “\serverUsers%USERNAME%desktop”, “REG_EXPAND_SZ”)

Leave a Reply