KpyM Telnet/SSH Server - Forum
Passing Files to batches
Tors10 Passing Files to batches
Is there a way to pass Consc a batch file with an input file?

I've tried:

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:
consc test.bat
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?

Kroum Grigorov
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:

C:\consc>set ip_address=

C:\consc>consc test.txt

Here is the test.txt file, it will echo the ip address you supply
SEND cls\n
SEND echo %ip_address%\n
SEND echo done\n
WAIT done
SEND exit\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
Powered by phpBB © 2001, 2005 phpBB Group