Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VBScript

Restart a GSM Modem using VBScript

0.00/5 (No votes)
2 Mar 2010CPOL 1  
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:exampleexample.ht 4. Add the below vbs file to your c:program FilesWindows 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.

MSIL
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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)