05-05-2014 03:11 PM
I have an application that I would like to run in Labview. How would I run in commad prompt the applicatoin C:\Program Files\Flash\FM.exe Options1 Options 2?The directory has to be set to C:\Program Files\Flash for the exe to be able to run. I am using Windows 7 LV 2013
05-05-2014 05:11 PM
What do you mean by "Options"? Are those specific commands or menus from FM.exe?
Not sure if you already know how to use SystemExec.vi. If you don't, look for it via ctrl+spacebar on your block diagram. Should look like below.
05-05-2014 05:38 PM
05-05-2014 11:52 PM
05-06-2014 12:14 PM - edited 05-06-2014 12:15 PM
Hm...now i'm curious...what's the purpose of the cmd/c?
I tested mine with cmd/c and got an error--image below. I took out the cmd/c and it worked fine.
05-06-2014 01:10 PM - edited 05-06-2014 01:13 PM
If you type "cmd /?" for the command switches list, it should explain the "/c":
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>cmd /? Starts a new instance of the Windows XP command interpreter CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string] /C Carries out the command specified by string and then terminates
It executes the command given and then terminates. For an instance such as this, it is probably unnecessary. I would try adding a space after the "cmd" and the "/c". This may remedy your issue.
05-06-2014 01:20 PM
MrHappyAsthma,
Thanks for that. I was actually just beginning to reply when I received a notification that you replied. I, too, noticed that I didn't have a space between "cmd" and "/c". Tried it this time and I received no error. However, the program I tested it on (called "Downloader.exe") didn't run when I had included "cmd /c". I saw the cmd screen flicker in and out, but it never opened. I then removed "cmd /c" and the executable opened, at which point my face went .
I'll be digging into the "why" later on. Hopefully i'll have time later today to look into it.
05-06-2014 02:09 PM
It most likely is opening the "downloader.exe" that you refer to and then terminating before you see any result with your own eyes. What does "downloader.exe" do? And what is your end goal?
This is why I mentioned it may not be necessary for your situation. 😛 This is how the mystery of Windows cmd works. Its not really a LabVIEW issue.
05-06-2014 02:22 PM
Well,
For my specific purpose, I use SystemExec.vi to run a specific upload function via Downloader.exe--used to work all the time until I received a couple of feedback which I am now troubleshooting... As for the OP, not sure what his FM.exe does.
05-06-2014 02:28 PM
Well all I can recommend then is if the "cmd /c' is causing the command prompt to terminate before the program successfully completes its task, then exclude it. If you prefer the command prompt to terminate upon completing its command, then use it. 😄