Start a Conversation

Unsolved

This post is more than 5 years old

618

April 1st, 2013 03:00

Client Tool via Jump host

Hello Team,

Kindly advice how to pass the argument from 1 .cmd file to an other .cmd file.

My requirement is to do telnet using Jump host. As of now I am able to login to Jump Host and calling telnet.cmd file but I am unable to pass IP from the main script to telnet.cmd.

main.cmd

@echo off
setlocal EnableDelayedExpansion

echo ********************************************
echo Device            = %SM_OBJ_ElementClassName%
echo Device Name       = %SM_OBJ_ElementName%
echo Device IP Address = %IP%
echo ********************************************


set telnet=C:\InCharge\CONSOLE\smarts\local\actions\client\telnet.cmd

echo %IP% >> %telnet%  -----> Problem lies here as I am unable to read IP in telnet.cmd( telnet.cmd file contains telnet $IP) it's not accepting $IP

set TELNET_DIRECTORY=C:\InCharge\CONSOLE\smarts\local\actions\client

rem ########################################################
rem
rem Do not modify anything below this line
rem
rem ########################################################

set EXECMD=start /wait

%EXECMD% %TELNET_DIRECTORY%\putty.exe -l root -m %remote% -pw XXXXX 10.10.10.10

Thanks,

170 Posts

April 2nd, 2013 07:00

Hi Arbas,

I've had a quick look at this, and the command which works for me (to call the telnet.cmd script and pass a parameter) is as follows:

set telnet=C:\InCharge\CONSOLE\smarts\local\actions\client\telnet.cmd

call %telnet% %SM_OBJ_Name%

Kind Regards,

Paul O'Rourke

No Events found!

Top