04-28-2010 12:21 AM
Thanks everyone!
I tried still can not. Can someone give me an example for the batch file? base one my eg example, thank a lot:
default path is: D:\Documents and Settings\Administrator>
I need go to C:\test and run "dir".
The path of the batch file will be the input of working directory?
david
04-28-2010 12:27 AM
Hi Rolf,
Actually the "dir" function is just a example, I need to run a lot of CMDs, so it's good to find a way to run multiple cmd lines with using system exec.vi.
I am still trying, will update later.
By the way, if anyone have the experience already, can show me a example ah? Appreciated for the help!
Regards!
David
04-28-2010 12:28 AM - edited 04-28-2010 12:31 AM
david.chang wrote:Thanks everyone!
I tried still can not. Can someone give me an example for the batch file? base one my eg example, thank a lot:
default path is: D:\Documents and Settings\Administrator>
I need go to C:\test and run "dir".
The path of the batch file will be the input of working directory?
david
You mean you have tried to pass "C:\test" as working directory and "cmd /c dir" as command line?
As to executing batch files you simply write a batch file and test it in the command shell to do what you want it to do and then invoke it through system exec. You might need to use "cmd /c mycommand.bat parameters" to pass to System Exec, since the CreateProcess Windows API they may be using inside SystemExec itself does not understand batch files but the command line utility will.
04-28-2010 12:34 AM
Rolf,
oh, sorry, maybe my example is misleading.
Actually I need to run saveral CMDs like cmd1, cmd2, cmd3.....in sequence, can I just call system exec.vi once and run multiple cmd lines?
Regards!
David
04-28-2010 12:37 AM
david.chang wrote:Rolf,
oh, sorry, maybe my example is misleading.
Actually I need to run saveral CMDs like cmd1, cmd2, cmd3.....in sequence, can I just call system exec.vi once and run multiple cmd lines?
Regards!
David
No you can't. You can however call System Exec multiple times, once for each command, which would be mostly equivalent.
04-28-2010 12:56 AM
04-28-2010 03:21 AM
I have tried to use the batch file, it's working. Now can process multiple commands in one step.
Great thanks to Rolf and Mike.
David
01-13-2011 08:21 AM
rolfk,
I'm not that familiar with DOS commands, especially through Labview System Exec. I will be trying out what your below email indicates. In the meantime I pose this issue. I have 3 commands through DOS..
1. burnboot.bat
2. burnconfig.bat P7A
3. burn ETF
Here's the kicker. When I launch the attached VI 3 seperate times, each time inputting the above commands (in order 1 thru 3) into the standard input control, it works fine. Command 1....press run button...VI completes | Command 2....press run button....VI completes | Command 3...press run button....VI completes. This process works fine and all operations successfully complete.
But when I've tried install a for loop to automatically do all 3 commands, command 1 will always work fine, then commands 2 and 3 are just real fast blips that do not perform the operations. There are no errors being spat out. I even tried the attached VI and imported into TestStand 3 times, each iteration having a different command. Again, command 1 works find, with commands 2 and 3 just flying by.
I've tried "waits" with no luck. Any help would be much appreciated. I think the answer to my problem is probably staring me int he face on this board, but again my DOS experience is limited.
Thank you for any help you can give. I'm using 8.5. with Windows XP.
You will find the commands that I use in the standard input control on the block diagram.
Best Regards,
Chazzzmd