I suspect this is because startup scripts run in the context of localSystem or the machine account when accessing network resources. If the file is remote, try granting the computer account explicit write permissions to the file and see if that helps.
 
 
Darren


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cothern, Jeffrey D Mr CTR USSOCOM HQ
Sent: Monday, March 27, 2006 11:23 AM
To: [email protected]
Subject: [ActiveDir] Script not working thru GPO

I have a script i created in vbs.  This script works when run on the machines locally but when i set it up as a machine startup script it gets this error
 
script:
path and name of script
 
Line:13
Char: 1
Error: Invalid Procedure call or argument
Code: 800A0005
Source:  Microsoft _vbscript_ runtime error
 
As I said this runs correctly when run on the machine localy but not thru GPO.  I am assuming that I cannot do a objFSO.OpenTestFile thru the GPO.  Is there some other way I can accomplish the write to the test file?
 
Jeff
 
 
 
   Here is the Script Code:
 
Dim WshShell, bKey
Dim regComputerName
Dim ComputerName
Dim Serverlist
Dim objServerlist
DIM objFSO
DIM strCurrenLine
DIM intIsComment
 
Serverlist = "\\fileserver\serverlist.txt"
regComputerName = "HKLM\SYSTEM\CurrentControlSet\Control" & "ComputerName\ComputerName\ComputerName"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objServerlist = objFSO.OpenTextFile(serverlist, ForAppending)
 

Set WshShell = WScript.CreateObject("WScript.Shell")
ComputerName = objShell.RegRead(regComputerName)
objfile.Write "ComputerName"
 
WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles", 1, "REG_DWORD"
WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles", 1, "REG_DWORD"
WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles", 1, "REG_DWORD"
 

bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles")
bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles")
bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles")
 
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles")
 

Reply via email to