|
Set Argv = WScript.Arguments
if Argv.Count = 0 then
Wscript.Echo "usage : cscript Start.vbs ServiceName Machine User Password"
Wscript.Quit
end if
on error resume next
if Argv.Count > 1 then
Set objNspace = GetObject("WinNT:")
Set objAdsi = objNspace.OpenDSObject( _
"WinNT://" & Argv(1), Argv(2), Argv(3), &H1 )
if Err.Number <> 0 then
Wscript.Echo Err.Description
Wscript.Quit
end if
else
Set objAdsi = GetObject("WinNT://.")
end if
Set obj = objAdsi.Create( "Service", Argv(0) )
Call obj.Start()
if Err.Number <> 0 then
Wscript.Echo Err.Description
end if
on error goto 0
Wscript.Echo strList
| |