LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec+ "CMD /C START DESK.CPL" won't work--why?

I've seen previous posts stating that the System Exec is the equivalent of the run box in windows (explaining why you can't execute commands like "dir").

However, I can run a line like this...

CMD /C START C:\WINNT\SYSTEM32\DESK.CPL
or
CMD /C START C:\WINNT\SYSTEM32\NIPORTS.CPL

..from the run menu, but not with System Exec+. CPL files of course are executables that load in the control panel and a WinNT shortcut will not show you the path.

The workaround is to create a batch file on the fly and execute the text above (since porting the application to a different computer means there might not be an existing batch file). The batch file looks like:

@CMD /C START C:\WINNT\SYSTEM32\DESK.CPL
@EXIT


I don't like having to generate a batch file inasmuch as it does get the job done, there is still the clunky dos box that flashes onto the screen for a brief second. Does anyone know what causes the above discrepancy? ...why it will run from the windows run box, but not with System Exec+? I'm guessing it has something to do with using the START command but I have never had to use it before in this fashion. Any ideas?
0 Kudos
Message 1 of 3
(3,535 Views)
I don't know about the niports.cpl but running the command for desk.cpl works (launches display properties) with the regular System Exec.vi with LabVIEW 6.1 and Win2K. It also briefly shows the DOS box. What OS and version of LabVIEW are you using?
Message 2 of 3
(3,535 Views)
Arg! You're right!

I originally tried this with NIPORTS.CPL and used DESK.CPL in the above example (without testing it) because everyone has desktop properties but not necessarily the port properties for the E-NET/RS-485 converter. I'm guessing there was a spelling or path error somewhere that wouldn't let my original attempt execute--it works now.

Also: I didn't realize that any time you execute CMD that it will show a dos box, not just for batch files. Oh well...

Thanks for your input...
0 Kudos
Message 3 of 3
(3,535 Views)