Batch Skript führt mit Plink nur den ersten Befehl aus
Hallo zusammen,
ich will mir ein batch skript erstellen, das mich automatisch auf einem Router einloggt, dort mehrere Befehle ausführt und sich wieder ausloggt.
Das sieht so aus:
In der befehlliste.txt steht dann z.B.:
Bis zum ersten ping funktioniert auch alles, aber dann werden keine weiteren befehle ausgeführt, im Kommandofenster sieht es aus als ob der Router auf Befehle wartet, aber keine bekommt.
Das gleiche passiert auch wenn ich versuche mehrer Dateien nacheinander vom PC auf den Router zu kopieren.
Komischerweise funktioniert es aber auf die gleiche Weise mehrer Dateien vom Router auf den PC zu kopieren.
Wenn ich ein Skript schreibe das direkt vom PC aus mehrere Ping-Befehle ausführen soll, also ohne Plink auf den Router, gibt es ebenfalls keine Probleme.
Hat schon mal jemand ähnliche Probleme gehabt oder weiß die Lösung?
Für hilfreiche Tips wäre ich sehr dankbar.
Grüße Eddie
Das sieht so aus:
plink -telnet 10.0.0.3 < befehlliste.txt
In der befehlliste.txt steht dann z.B.:
usernamepasswordping 10.0.0.8ping 10.0.0.7ping 10.0.0.6exit
Bis zum ersten ping funktioniert auch alles, aber dann werden keine weiteren befehle ausgeführt, im Kommandofenster sieht es aus als ob der Router auf Befehle wartet, aber keine bekommt.
Das gleiche passiert auch wenn ich versuche mehrer Dateien nacheinander vom PC auf den Router zu kopieren.
Komischerweise funktioniert es aber auf die gleiche Weise mehrer Dateien vom Router auf den PC zu kopieren.
Wenn ich ein Skript schreibe das direkt vom PC aus mehrere Ping-Befehle ausführen soll, also ohne Plink auf den Router, gibt es ebenfalls keine Probleme.
Hat schon mal jemand ähnliche Probleme gehabt oder weiß die Lösung?
Für hilfreiche Tips wäre ich sehr dankbar.
Grüße Eddie
Please also mark the comments that contributed to the solution of the article
Content-Key: 120210
Url: https://administrator.de/contentid/120210
Printed on: April 23, 2024 at 16:04 o'clock
3 Comments
Latest comment
[quote]
Usage: plink [options] [user@]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
[/quote]
Option -m ???
Usage: plink [options] [user@]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
[/quote]
Option -m ???