Login | |
|
 |
Active Directory - VBS Computer Policy Script - 3/21/2006 5:10:33 AM
|
|
 |
|
| |
tbraga
Posts: 41
Score: 0
Joined: 2/1/2006
Status: offline
|
Hi All, I have this script (below) that I have written. It copies some files then checks against the registry and if a specific key is not found then it continues down the if statement to install an application. Lastly it places that registry key within the registry, therefore it will only run the executable once. I am running this through Active Directory's Group Policy as a computer startup script. The script itself works fine, the logic and syntax is correct but when i apply it to the computer it doesn't write to the registry or do anything with the registry for that matter...but it does copy the files, therefore it must be something with the registry. everything works fine when i set it as a user login script but i am trying to avoid that. I feel it is a permissions thing with the registry and was wondering if anyone had dealt with this type of issue before. Thanks, Tim '*******************************************************************' ' Tim Braga *' ' 02/16/2006 *' ' Script : This scripts launches the .BAT for installation of *' ' Prolog Manager 7.5 SP2 *' '*******************************************************************' '*******************************************************************' ' Set Variables and Apply Libraries *' '*******************************************************************' On error resume next Set WSHShell = WScript.CreateObject("WScript.Shell") test = wshshell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Shawmut\GPO\PrologManager75SP2\PrologManager75SP2") CitrixW = "W:" CitrixX = "X:" '******************************************************************************' ' IF Statement - IF Ultipro953 Registry Key Exists, Abort, Else Run Bat File *' ' IF W or X Drives exists, Abort *' '******************************************************************************' Const OverwriteExisting = TRUE Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.CopyFile "c:\shawmut\super\safety\*" , "c:\test\", OverwriteExisting ' If test > 0 Then ' MsgBox("RegKey Exists") ' Else ' MsgBox("RegKey Doesn't Exists") ' end if ' wscript.echo test ' If test > 0 Then ' WScript.Quit ' Else ' WSHShell.Run "\\sdc-ris\MSI_Package\Prolog75SP2\Meridian_Systems_Prolog_Manager_75SP2.exe" ' end if ' wscript.echo test '******************************************************************************' ' Merge Registry Entry - (HKLM) *' *' '******************************************************************************' WshShell.run "regedit /S ""\\sdc-ris\MSI_Package\Prolog75SP2\Prolog75SP2_Installed.reg""",0,True
|
|
| |
|
|
|
|
|