LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

system exce command

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

0 Kudos
Message 1 of 10
(3,177 Views)

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.

 

systemexec copy.jpg

-Mitch
0 Kudos
Message 2 of 10
(3,149 Views)
Also read the help for the system exec vi, note you will likely need the cmd /c at the beginning.
Michael
0 Kudos
Message 3 of 10
(3,139 Views)

Hi jamridge,

 

  Please find the block diagram attached.

System.png

 

Regards,

SrikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 4 of 10
(3,119 Views)

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.

 

 

cmd error.jpg

-Mitch
0 Kudos
Message 5 of 10
(3,089 Views)

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.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 6 of 10
(3,076 Views)

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 Smiley Surprised.

 

 

I'll be digging into the "why" later on.  Hopefully i'll have time later today to look into it.

-Mitch
0 Kudos
Message 7 of 10
(3,063 Views)

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.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 8 of 10
(3,053 Views)

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.

-Mitch
0 Kudos
Message 9 of 10
(3,042 Views)

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. 😄

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 10 of 10
(3,036 Views)