Here is the code I have which I am including in the computer startup script for all my machines. The problem is that it will always run. The first condition to check to see if this file exists is somehow not working and the machine thinks that the file is never there. I have verified that it is on each of the clients running this script. If you can look at my other options as well that would be great. My goal is to make it so that if the VPTray.exe program doesn't exists it will run the savcenrb.exe program that will install Norton behind the schemes, then copy the grc.dat file from the server to the workstations correct spot in order to join the workstation to the Norton Corporate Server. Finally I want it to pause for 5 minutes in order for the client to process the GRC.DAT file and join to the Norton Server. This is all topped off with a reboot using psshutdown. From the code I have what is out of place and what will not process correctly. I really appreciate any help you can provide.
thanks
thanks
Code:
[sup]
On Error Resume Next
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'Replace the server and share with the server the script is placed on
If Not oFSO.FileExists("%SYSTEMDRIVE%\Program Files\Symantec_Client_Security\Symantec AntiVirus\VPTray.exe") Then
rc=WSHShell.Run("\\sacaton-dc\UTILS\Packages\NortonAV\savcenrb.exe", 1, True)
rc=WSHShell.Run("cmd /c copy \\sacaton-dc\vphome\GRC.DAT ""%SYSTEMDRIVE%\Documents and Settings\All Users\Application Data\Symantec\Norton Antivirus Corporate Edition\7.5 /y""", 1, True)
WScript.sleep 200
rc=WSHSHell.Run("cmd /c copy \\sacaton-dc\netlogon\psshutdown.exe %SYSTEMROOT%\system32 /y", 1, True)
rc=WSHShell.Run("cmd /c %systemroot%\system32\psshutdown.exe -r", 1, True)
End If
Set oFSO = Nothing
WScript.Quit(0)
[/sup]