65.9K
CodeProject is changing. Read more.
Home

Restart a GSM Modem using VBScript

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Mar 3, 2010

CPOL
viewsIcon

11880

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 4. Add the below vbs file to your c:\program Files\Windows NT directory and execute. Important: If you saved...

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 4. 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