0

I have shell command which runs batch file with parameters below code all works fine

WshShell.Run ( '"H:\\Workspace\\testcomplete\\TCAF - QIKSilver\\test.bat" ' +  + a + ' ' + b + ' ' + c); 

The batch file path is not constant I would like to pass it dynamically

d= Project.Path; // I get the path of my project
value = d.replace(/\\/g, "\\\\");// replace single backslash with double slash
filepath = value.concat("test.bat") // value of filepath varialbe is -H:\\Workspace\\testcomplete\\TCAF - QIKSilver\\test.bat

Following is not working:

WshShell.Run ('filepath' + a + ' ' + b + ' ' + c); 

any suggestions please

This code is written inside test complete using java script

2 Answers 2

0

Try this:

WshShell.Run (filepath+' '+ a + ' ' + b + ' ' + c); 
Sign up to request clarification or add additional context in comments.

Comments

0

You need to use filepath as a variable, not string, and you need to add quotes since your path contains spaces:

WshShell.Run('"' + filepath + '" ' + a + ' ' + b + ' ' + c);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.