Click here to Skip to main content
15,889,992 members
Articles / Programming Languages / VBScript
Tip/Trick

Restart a GSM Modem using VBScript

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
2 Mar 2010CPOL 11.7K   3  
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.

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)


Written By
Team Leader
South Africa South Africa
This member doesn't quite have enough reputation to be able to display their biography and homepage.

Comments and Discussions

 
-- There are no messages in this forum --