Posts Tagged VBScript

ShwetaHow to restart a windows service using VBScript

Thursday, March 4th, 2010

You can restart a windows service with the use of VBScript as shown in the below code snippet:

Set oshell = createobject(”Wscript.Shell“)
oshell.run”
cmd.exe
wscript.sleep
500
oshell.sendkeys “
net stop “”Your service name here“”"+(”{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
net start “”Your service name here“”"+(”{Enter}”)
wscript.sleep
5000
oshell.sendkeys “
exit“+(”{Enter}”)

set oshell = nothing

WScript.Quit

`
http://www.all1press.com

http://www.all1tunes.com

Tags: , , ,
Posted in Editorial, Purely Technical | No Comments »

SuzanneHow to restart a GSM Modem using VBScript-

Wednesday, March 3rd, 2010

Now you can restart a GSM Modem with the use of VBScript-

1. Copy the script code and save as a .vbs file.
2. Open hyperterminal and setup the modem settings, for this example save the hyperterminal file as c:\example\example.ht
3. Add the below vbs file to your c:\program Files\Windows NT directory and execute.

Important: If you saved the .ht as anything other than example.ht in c:\example rename the file in script below as well.

Set oshell = createobject(”Wscript.Shell”)
oshell.run”cmd.exe”
wscript.sleep 500
oshell.sendkeys “hypertrm.exe c:\example\example.ht”+(”{Enter}”)
wscript.sleep 1500
oshell.sendkeys “at{+}cfun=1″ + (”{Enter}”)
wscript.sleep 4000
oshell.sendkeys”at” + (”{Enter}”)
wscript.sleep 1500
oshell.sendkeys “at{+}cfun=1″ + (”{Enter}”)
wscript.sleep 4000
oshell.sendkeys”at” + (”{Enter}”)
wscript.sleep 1500
oshell.sendkeys”%f”
wscript.sleep 1500
oshell.sendkeys”x”
wscript.sleep 1500
oshell.sendkeys(”{Enter}”)
wscript.sleep 1500
oshell.sendkeys”exit”+(”{Enter}”)
set oshell = nothing

Set oshell = createobject(”Wscript.Shell”)
oshell.run”cmd.exe”
wscript.sleep 500
oshell.sendkeys “hypertrm.exe c:\example\example.ht”+(”{Enter}”)
wscript.sleep 1500
oshell.sendkeys “at{+}cfun=1″ + (”{Enter}”)
wscript.sleep 4000
oshell.sendkeys”at” + (”{Enter}”)
wscript.sleep 1500
oshell.sendkeys “at{+}cfun=1″ + (”{Enter}”)
wscript.sleep 4000
oshell.sendkeys”at” + (”{Enter}”)
wscript.sleep 1500
oshell.sendkeys”%f”
wscript.sleep 1500
oshell.sendkeys”x”
wscript.sleep 1500
oshell.sendkeys(”{Enter}”)
wscript.sleep 1500
oshell.sendkeys”exit”+(”{Enter}”)
set oshell = nothing

http://www.all1social.com
http://www.all1martpro.com

Tags: , , , , ,
Posted in Editorial, Purely Technical | No Comments »