04-09-2008 06:29 PM
04-09-2008 08:43 PM
04-10-2008 10:25 AM
awesome, thanks. works now.
and why dont the NI doc's indicate this??? (sarcasim... not expecting an answer 😉 )
04-10-2008 11:15 AM
04-10-2008 11:21 AM
steve05ram360 wrote:
awesome, thanks. works now.
and why dont the NI doc's indicate this??? (sarcasim... not expecting an answer 😉 )
04-10-2008 11:40 AM
04-27-2010 04:02 AM
I have an other question, i have several cmd lines need to execute, but each time when calling the "system exec.vi" can just run one single cmd, is that right? Is there any way to execute multiple lines?
for eg. my default path is: D:\Documents and Settings\Administrator>
I need go to C:\test and run "dir".
Everytime call the exec.vi will go to the default directory. Anyone can help to show me how to execute the multiple cmd lines.
Thanks!
david
win xp, lv 8.6
04-27-2010 04:14 AM
Hi David,
write your cmds into a batch file and run it with the SystemExec function.
Mike
04-27-2010 05:30 AM
MikeS81 wrote:Hi David,
write your cmds into a batch file and run it with the SystemExec function.
Mike
... if the commands change according to the program output:
Create the batch file just before you need it and delete it after running it so you don't fill the HDD with useless files.
James
04-27-2010 06:14 AM - edited 04-27-2010 06:15 AM
For general multi commands through System Exec everything so far has been right. However the working directory parameter for System Exec should actually take care about the initial set dir command already. So no need to have a seperate command executed for that. Also the dir command is not an application on the system but an internal command to the DOS command line so you will have to execute it with "cmd /c dir" since the System Exec is not a normal DOS command line but simply accesses the OS means to startup a process. So if you need command line functionality you have to explicitedly launch it first.
As to the original poster problem, it has most likely to do with parsing the command line parameters into a command argument list. Not sure if the LabVIEW System Exec does that and how. Depending what Windows API functionality it uses to create the process it may have to do all the parsing but somehow fail on multiple arguments. Going through cmd lets cmd parse the entire parameter list which seems to work better for multiple arguments.