Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple vb query

Status
Not open for further replies.

baggies1

IS-IT--Management
Oct 28, 2009
33
GB
when running a "sc sdshow spooler" from the command line i get SDDL for spooler service.

so why doesnt below work?

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%comspec% /c sc sdshow spooler",0,true

also when i try

Set WshShell = WScript.CreateObject("WScript.Shell")
result = WshShell.Run ("%comspec% /c" & "sc sdshow spooler",0,true)
wscript.echo result

i get result returned '0'.

does anyone have any ideas?

thsanks.
 
i notice that if i dont set the variables for wshshell run (ie 0,true) it outputs to another command window.

in this window i can see the correct result.

but when i set to 0,true is does not display in this main window.
 
bWaitOnReturn defaults to False, not True.

In any case this is script, not VB. You want forum329 instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top