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
Process.execute command error
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
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
-
- Newbie
- Posts: 9
- Joined: Tue Mar 18, 2014 3:17 pm
Process.execute command error
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 .
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
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" )...
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" )...
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
Process.execute command error
var exitStatus = Process.execute( s.getPropertyValue( "Batchfile" ) );