Page 1 of 1
Process.execute command error
Posted: Fri Mar 28, 2014 10:47 am
by pradeepnitp
I have one cmd file which I want to execute via switchScripter
Switch Scriptercode is as below
var t = new Array("E:Enfocus_Flows_Testtest.cmd");
Process.execute(t)
This is always returning 1 and folder is also not created
If I run the cmd file manually then it is running fine.
test.cmd content is as below
cd E:Enfocus_Flows_Test
mkdir test2
Process.execute command error
Posted: Fri Mar 28, 2014 5:55 pm
by freddyp
Apart from the fact that you have not finalized the Process.execute line with a semicolon I do not immediately see what is wrong, but I cannot test it on Windows right now.
Anyhow, why would you run a command file to create a directory when you can create one with the scripting API? Look under Scripting Reference - Utility Module - Dir Class.
Freddy
Process.execute command error
Posted: Fri Mar 28, 2014 7:58 pm
by pradeepnitp
HI Freddy Semicolon was miss in typing .
Actually I need to do other stuffs inside cmd file .I thought of testing with small directory creation and even this is not working .
Process.execute command error
Posted: Thu Apr 03, 2014 11:45 am
by tz8
create a property for the script and give it a "choose file" option. Then choose the test.cmd.
var args = new Array();
args.push( s.getPropertyValue( "Batchfile" ) );
var p = new Process( args );
p.start();
p.waitForFinished();
this always did the trick for me as the notation of filepaths can be rather tricky in SwitchScripter. You could also test Dir.convertSeparators( "c:blatest.cmd" )...
Process.execute command error
Posted: Fri Apr 04, 2014 8:40 pm
by dkelly
var exitStatus = Process.execute( s.getPropertyValue( "Batchfile" ) );