|
You
need to open the same file for reading first, read all the lines into an array…
then run a do/while or for/next statement against the array to check if there’s
a name match. :m:dsm:cci:mvp |
marcusoh.blogspot.com From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cothern,
Jeffrey D Mr CTR USSOCOM HQ Foudn that
problem and the other which was with objShell Here is the
working script. Now to find a way to have it check if the server name is
already in the serverlist.txt file and if so skip to the end. Dim
regComputerName Serverlist
= "\\fileserver\serverlist.txt" Set
objShell = CreateObject("WScript.Shell") objShell.RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles",
1, "REG_DWORD" From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED] What’s objFile
being set to? Set WshShell =
WScript.CreateObject("WScript.Shell") Hmm maybe I’m
missing something entirely because I don’t see where objShell is being
set to anything either… ? :m:dsm:cci:mvp |
marcusoh.blogspot.com From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cothern,
Jeffrey D Mr CTR USSOCOM HQ Thank you
That fixed that line.. Now to
another line. As I mentioned before this script works fine outside of
GPO.
Do you see anything wrong with
ComputerName = From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Darren Mar-Elia Good catch Kamlesh. Jeff,
check out: http://msdn.microsoft.com/library/default.asp?url=""> for an example of this. From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kamlesh Parmar If
this is the exact script then Where
have you defined value of "ForAppending" ?? As error
message contains "invalid argument" -- Kamlesh On 3/28/06, Cothern, Jeffrey D Mr CTR USSOCOM HQ <[EMAIL PROTECTED]> wrote: 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 Serverlist = "\\fileserver\serverlist.txt"
WshShell.
RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles",
1, "REG_DWORD"
WScript.Echo
WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles")
|
- RE: [ActiveDir] Script not working th... Marcus.Oh
- Re: [ActiveDir] Script not worki... Kamlesh Parmar
- RE: [ActiveDir] Script not worki... Cothern, Jeffrey D Mr CTR USSOCOM HQ
- RE: [ActiveDir] Script not worki... Cothern, Jeffrey D Mr CTR USSOCOM HQ
- RE: [ActiveDir] Script not worki... Brian Desmond
