KpyM Telnet/SSH Server - Forum
|Passing Files to batches
||Passing Files to batches
||Nov 15 2006 20:51
Is there a way to pass Consc a batch file with an input file?
consc test.bat ipaddress
which said can't parse command at line 0
consc "test.bat ipaddress"
which said can't open file test.bat ipaddress
consc 'test.bat ipaddress'
which said can't open file 'test.bat
I'm trying to make use of the %1 operator when making my ssh connection...
I've noticed that:
gives me the same error as as the first one that I posted. I'm assuming that consc takes all of the inputs as files to parse + execute, which means that it will not input the correct values to fill in the ipaddresses.
Can anyone think of a workaround?
||Nov 17 2006 14:44
You can't pass batch file directly to consc.
It has to be consc script file, it means you have to add 'SEND ' before each line of the batch file and '\n' et the end.
You can't pass additional parameters either however you can use ENVIRONMENT variables instead.
For example to pass the ip address you can do something like this:
Here is the test.txt file, it will echo the ip address you supply
SEND echo %ip_address%\n
SEND echo done\n
You can wrap set command and consc command in a batch file that accepts multiple parameters on the command line.
© 2007 - 2008 Kroum Grigorov