It's time to share something.
Script made in AHK.
Auto connect to a shell with putty or telnet and send command defined in the text file.
Quote:
Hi all.
If you want to change the script or configurations
you can Delete config.ini and run AutoTelnet or simply edit the .ini file.
Script.txt is the file where you put the commands which you would like to send.
I recommend to use Putty for telnet to avoid some chars (\, |, <, >, [, ]) problems which Microsoft Telnet does.
Use "Sl33p, milliseconds" for delay send between lines.
For force exit use "+exit". Use it if telnet or putty don't closed with standard exit command at the end of the script.
v1.3
1) Comment a single line with semicolon ";" (; Sl33p, 1000)
2) Ability to start the application Minimized or Maximized.
3) Added "RUN, <path>" (uppercase, case sensitive) for run an application on the local PC from the script.
4) Bugfix: in some cases AutoTelnet skipping a line of the script.
v1.2
1) Password can't be read from config.ini as text (simple crypter, just for hide)
2) Added "Silent Mode" that disables the "Done" message box.
3) Added command line support for custom .ini and .txt files.
Usage: autotelnet.exe <ini_filename> <script_filename>
v1.12
1) Added "Slow Mode". Use it if you got lowercase/uppercase, and non letters problems such (\, |, <, >, [, ],{,})
2) No more known limitation. Now you can send { } brackets (Slow Mode needed)
v1.11
Small bugfix
v1.1
1) Bugfix
2) Added Sleep in "Commands to send" window. (Wait X milliseconds between lines)
With negative value the script is a bit faster but it can cause skips.
3) Added "Sl33p, <ms>" command. (Wait X milliseconds for a single line)
4) Supports SSH with Putty (putty.exe -ssh IP)
5) Added "+exit" command that sends exit and kill the process (putty, telnet or any other)
Command Line Examples:
1) autotelnet.exe box1.conf script_1.txt (if files dont exist it create box1.conf and script_1.txt)
2) autotelnet.exe box1.conf (if files dont exist it create box1.conf and script.txt)
(if script_filename omitted script.txt will be used, just script_file cant be used)
3) autotelnet.exe (no command line parameter, uses default conf.ini and script.txt)
Script Example (script.txt file):
ps x
; with removing semicolon in the line below will send " ls"
; ls
Sl33p, 1000
help
; the line below wait for 2 secs and then continue (2000ms)
Sl33p, 2000
RUN, shutdown.exe -s -t 120
; shutdown your PC after 120 secs
Sl33p, 5000
RUN, C:\WINDOWS\system32\shutdown.exe -a
; abort the shutdown process
+exit
Scripter: DJAnonimo
Download