Check permissions on that file/folder - if you're running
this as a machine startup script then the group "domain computers" will need to
be able to write to it (and almost certainly won't have those rights unless
you've added them before)
Steve
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cothern, Jeffrey D Mr CTR USSOCOM HQ
Sent: 27 March 2006 20:23
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
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)
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"
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")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles")
