ajtsystems
IS-IT--Management
Hi,
I need to run a cmd invisible using VBScript, here is my code so far:
ipaddress ="212.58.228.30"
Set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.run("telnet " & IPAddress & " 21"),1
WScript.Sleep 500
WshShell.AppActivate "telnet"
WScript.Sleep 500
wshShell.SendKeys "user username"
WScript.Sleep 500
wshShell.SendKeys "{Enter}"
wshShell.SendKeys "pass password"
wshShell.SendKeys "{Enter}"
I am using wshell.run as it can run hidden with ,1: wshShell.run("telnet " & IPAddress & " 21"),1.
The problem I have is that wshshell.appactive "telnet" requires wshShell.exec("telnet " & IPAddress & " 21") but cannot run invisible\hidden.
Can anyone see a way to run telnet in a hidden window for seurity reasons I cannot run it viewable...and I cant find anything in CMD help for it...?
Thanks
Any help really appreciated...
James
I need to run a cmd invisible using VBScript, here is my code so far:
ipaddress ="212.58.228.30"
Set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.run("telnet " & IPAddress & " 21"),1
WScript.Sleep 500
WshShell.AppActivate "telnet"
WScript.Sleep 500
wshShell.SendKeys "user username"
WScript.Sleep 500
wshShell.SendKeys "{Enter}"
wshShell.SendKeys "pass password"
wshShell.SendKeys "{Enter}"
I am using wshell.run as it can run hidden with ,1: wshShell.run("telnet " & IPAddress & " 21"),1.
The problem I have is that wshshell.appactive "telnet" requires wshShell.exec("telnet " & IPAddress & " 21") but cannot run invisible\hidden.
Can anyone see a way to run telnet in a hidden window for seurity reasons I cannot run it viewable...and I cant find anything in CMD help for it...?
Thanks
Any help really appreciated...
James