Page 1 of 1

Execute a CMD command with -CLI option

Posted: Wed Sep 13, 2006 3:18 am
by Alex_sp
Hi to all,
I've to execute a dynamic command (CMD) like "mk XXXX" where XXXX takes different values.
I'm using a batch File adapter as target, but I don't know how to code it.
How I can execute a dynamic command? wiht -CLI?

Posted: Thu Sep 14, 2006 3:20 am
by janhess
You could use the batch adapter calling a batch file with a parameter
eg

=valid(PUT("BAT","-cmd ""ftpcmd.bat " + filename"" -P 30:10 -tv -I"," "),fail("run ftp failed " + TEXT ( LASTERRORCODE ( ) ) + " " + LASTERRORMSG()))

where filename was the parameter to the batch file. So you could have mk %1.

Posted: Thu Sep 14, 2006 12:11 pm
by jgibby
To me the documentation on the Batch/Shell adapter was totally confusing. Finally I hit on the following that works (so far) for all our needs:

Code: Select all

=GET("SHL","-cli -cmd 'mkdir " + DirName + "'")
Hope it helps,
John