Monday, December 10, 2012

Three quick Scripting tips


1.       Call a batch file from inside a .vbs script and wait for bat file to complete before continuing.

Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run("%comspec% /K MyFile.bat"), 1, True


2.       DOS command to stop/start  a service on a remote machine

sc \\MyServer2 stop "Some TRBLSM Service"


3.  DOS command to wait a duration of seconds before continuing on

timeout 5
 

No comments:

Post a Comment