use Net::Telnet; BEGIN { $|=1 } $user = "administrator"; $pass = 'crt@123'; $telnet = new Net::Telnet ( Timeout=>20, Errmode=>'die', Prompt => '/[%#>] ?$/', Dump_Log=>"dumplogs.txt", Input_log=>"inputlogs.txt", Output_log=>"outputlogs.txt"); $telnet->open('10.217.50.218'); $telnet->login(Name=>$user, Password=>$pass, Prompt => '/[%#>:] ?$/'); $command = qq(ipconfig && hostname); print "command is: [$command]\n"; @output = $telnet->cmd(String=>$command); print "output is:\n@output\n"; exit; #### C:\Compatibility_Automation_Temp>perl test1.pl command is: [ipconfig && hostname] output is: Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : crt.com Link-local IPv6 Address . . . . . : fe80::a489:bdd0:bbd7:748a%11 IPv4 Address. . . . . . . . . . . : 10.217.50.218 Subnet Mask . . . . . . . . . . . : 255.255.252.0 Default Gateway . . . . . . . . . : 10.217.48.1 Tunnel adapter isatap.crt.com: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : crt.com WIN-3K3OARCE05I C:\Users\Administrator