Jump to content

Recommended Posts

Posted

I am a very lazy person and like to find ways to make my job simpler. I often have to reconfigure Wireless Access Points and only need to change some info for each AP.

 

The bits i need to change are password, SSID, WPA Key, AP name and IP Address.

 

I have recently discovered that the AP's we use support the use of telnet to change ALL these. I looked into ways of automating the process using WshShell.SendKeys and a script based loosely on this:

 

set oShell = CreateObject("WScript.Shell")
oShell.run("Telnet")
WScript.Sleep 1000
oShell.SendKeys("Open 127.0.0.1 23")
WScript.Sleep 1000
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
oShell.SendKeys("n")
WScript.Sleep 1000
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
oShell.SendKeys"MyName"
WScript.Sleep 1000
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
oShell.SendKeys("MyPassword")
WScript.Sleep 1000
oShell.SendKeys("{Enter}")
WScript.Sleep 1000
oShell.SendKeys("MyCommand")
WScript.Sleep 1000
oShell.SendKeys("{Enter}")
WScript.Sleep 1000

 

What i want to do though it have a msgbox pop up and ask for the ip address of the AP, the new SSID and the new IP. The rest of the info is standardised across the board. The pop up works ok and i can type the ip address in and then click ok, the rest of the script runs ok until it gets to the ip address.

 

Where the ip is hardcoded in above my script reads:

 

oShell.Sendkeys "o " & ip <-- the ip variable had already been declared prior to this and it is the input of the message box

 

What happens is that the output is this:

 

Welcome to Microsoft Telnet Client

 

Escape Character is 'CTRL+]'

 

Microsoft Telnet> o

( to )

usage: open hostname port

Microsoft Telnet> admin

Invalid Command. type ?/help for help

Microsoft Telnet>

 

so where the ip is supposed to be i get nothing

 

Anyone able to help me?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...