April 15th, 2005, 12:23 AM
Scripting windows Telnet
Some time ago I was looking for and couldn’t find a way to have scripted telnet sessions for someone I know who works in air conditioning that said he could really use one. Now that I have a solution id like to share it…someone might need it someday who knows.
An easy way to do this is in notepad.
Write all the commands down as if it were a batch file and be sure to add a new line at the end to execute the last command. Select all, copy and paste it right into the telnet session. If you running 2k you can do this by simply right clicking on the DOS window after coping from notepad. The buffer will enter and execute each command in turn. The XP command window opens an options menu when right clicked so just select paste. (this is the feature I hate most about XP)
Save it with a descriptive name if you think your might need it in the future.
If you’ve flipped out and want to use telnet as your mail client for some reason or check for open relays this can save allot of time
I know everyone’s going to say telnet this and telnet that, but the reason that im passing this on to those who aren’t aware of it is…. This can be done with any command line program that doesn’t have a gui.
If I have to make a change to all the computers on the network. I use a for loop, psexec and a list of computers (FOR /f “tokens=1” %X in (allcomps.txt) do psexec %X –s cmd). Copy the commands once (last command being exit followed by a new line) and just right-click on the dos window every time a shell opens. Great for changing .ini files or copying a new shortcut to everyone’s desktop.
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
February 29th, 2008, 11:48 AM
I know this is an old post and i had i bit of trouble findig it.. but it was worth it.
It is strange that noone else seems to know your solution to automating (Microsoft) telnet.. You deserve a medal!!
February 29th, 2008, 12:24 PM
Experience is something you don't get until just after you need it.