"Ed" <edvin[ at ]edloci.com> wrote in message news:eN8YvBqOJHA.1744[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text] > Have a Machine Startup Script configured on GPO. I need to run the windows > "Uptime" command and > email the result. When I run the script manually it runs fine, on startup > it doesn't run (GPO times out). > The Authenticated Users and Domain Computers have Full access on the > script folder. > > Is it because of Uptime ? How can I run this on Startup ? > > > Script is something like this: > > strRun="%logonserver%\NETLOGON\uptime /s /p:30" > Set objScriptExec = objShell.Exec(strRun) > strUptimeResult = replace(objScriptExec.StdOut.ReadAll,vbNewLine,"<br>") > > email strUptimeResult
I would start with a simple command, then build it up until the script fails, e.g. like so:
Step 1: strRun="c:\windows\system32\cmd.exe /c echo %time% >> c:\test.txt"
Step 2: strRun="c:\uptime.exe /s /p:30 >> c:\test.txt" (You need to copy uptime.exe to c:\)
Step 3: strRun="%logonserver%\NETLOGON\\cmd.exe /c echo %time% >> c:\test.txt" (you need to copy cmd.exe to your netlogon share)
Step 4: strRun="%logonserver%\NETLOGON\uptime /s /p:30"
In each case you must replace the line Set objScriptExec = objShell.Exec(strRun) with objShell.run strRun , 1, true in order for the tests to work. By making a note of the step that fails you can probably resolve the issue.
|