Hi Everyone, I have a question regarding script syntax. I have numerous
examples of how to script WMI this way, but I'm bound and determined to
figure out why my script won't compile and run properly.
Here's the command prompt way of doing what I want:
C:\>runas /user:username "SHUTDOWN -R -F -M \\VCALDISP-1l -t 5" |
J:\SUPPORT\SANUR\SANUR password
This works perfectly.
Here's one version of the script I'm working on, but no matter how I format
the cCmd var, the script errors out:
(watch out for word wrapping)
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
cCmd = "runas /user:username " & """ & "SHUTDOWN -R -F -M
\\VCALDISP-3S-VIS -t 5 " & """ & " | J:\SUPPORT\SANUR\SANUR password"
oShell.run cCmd
Set oShell = Nothing
Can anyone tell what's wrong?
Thanks.
--
William Fields
MCSD - Microsoft Visual FoxPro
MCP - Win2k Pro
US Bankruptcy Court
Phoenix, AZ
Bruce Lee was the man. Be water.