Using the system function, it would open up a new cmd window when executing each command. This way I could execute more than one command simultaneously. (Previously, it was using the cmd window that I was executing the script in to run each command, but this posed a problem, because after a command was executed, if it took 30 seconds, it skipped other scheduled commands that were scheduled within 30 seconds of the first command). Anyways, I currently am messing around with the Telnet module so I can execute commands on remote hosts, and my current code for executing a command with Telnet is this:system("start $separate_command") and die $!,$?,$^E;
The above code runs telnet in the window the script is running. My question: Is there a way to have it run the telnet commands above, in a separate window, like it was doing when I was using the system() function?use Net::Telnet(); $commandExecution = new Net::Telnet(Host=>$location, + Dump_Log=>"debug.txt", + Prompt=>'/C:\\\\>.*$/'); $commandExecution->login($username,$password); $commandExecution->print($separate_command); $commandExecution->waitfor('/.+$/'); $commandExecution->close;
In reply to Using Net::Telnet Module on Windows machine by Edge118
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |