我有 shell 命令,它使用以下代码运行批处理文件,一切正常
WshShell.Run ( '"H:\\Workspace\\testcomplete\\TCAF - QIKSilver\\test.bat" ' + + a + ' ' + b + ' ' + c);
批处理文件路径不是恒定的,我想动态传递它
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
以下内容无效:
WshShell.Run ('filepath' + a + ' ' + b + ' ' + c);
有什么建议请留言
这段代码是使用java脚本在测试中编写的
最佳答案
试试这个:
WshShell.Run (filepath+' '+ a + ' ' + b + ' ' + c);
关于javascript - 动态传递路径值Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25635712/