Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Telnet connection shorcut using VBSCRIPT

Status
Not open for further replies.
Aug 14, 2003
94
US
Hello everyone,

I'm trying to make a script that creates a Telnet shortcut on all users desktop,The script i have creates the shortcut.
The problem is i want to configure the target path to connect to an IP address and port for example C:\WINDOWS\system32\telnet.exe 192.168.1.10 :3000

How do i do this? The script I have so far is below

Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("AllUsersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\Telnet.lnk")
objShortCut.TargetPath = "C:\WINDOWS\system32\telnet.exe"
objShortCut.Description = "TELNET"
objShortCut.HotKey = "Ctrl+Shift+I"
objShortCut.Save
 
what does changing
objShortCut.TargetPath = "C:\WINDOWS\system32\telnet.exe"
to
objShortCut.TargetPath = "C:\WINDOWS\system32\telnet.exe 192.168...... etc "

do?
 
It can't create the shorcut because it is looking for 192.168 etc.. in the path provided. Which obviously won't exist.
 
ok fair enough, how about the aruments property?

shcut.TargetPath = wpath + "\GrpWise.exe"
shcut.arguments = " /@u-" & Uname & " /Ipa-" & Ipa
 
I'm a bit confused how do i add this to the script? Where do i enter 192.168.10.10 :3000? I'm a newbie, still learning

shcut.TargetPath = wpath + "\C:\WINDOWS\system32\telnet.exe"

shcut.arguments = " /@u-" & Uname & " /Ipa-" & Ipa
 
'note the .Arguments extra line
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFolder = objShell.SpecialFolders("AllUsersDesktop")
Set objShortCut = objShell.CreateShortcut(strDesktopFolder & _
"\Telnet.lnk")
objShortCut.TargetPath = "C:\WINDOWS\system32\telnet.exe"
objShortCut.Arguments = " 192.168.1.10 :3000"
objShortCut.Description = "TELNET"
objShortCut.HotKey = "Ctrl+Shift+I"
objShortCut.Save
 
The correct syntax is telnet host port (without colon):
objShortCut.Arguments = "192.168.1.10 3000"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top