cancel
Showing results for 
Search instead for 
Did you mean: 

system exce command

jamridge
Member

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

9 REPLIES 9
Mitchum
Member

Re: system exce command

Message contains an image

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
Michael_78
Active Participant

Re: system exce command

Also read the help for the system exec vi, note you will likely need the cmd /c at the beginning.
Michael
srikrishnaNF
Active Participant

Re: system exce command

Message contains an image

Hi jamridge,

 

  Please find the block diagram attached.

System.png

 

Regards,

SrikrishnaNF

Regards,
Srikrishna


Mitchum
Member

Re: system exce command

Message contains an image

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
Highlighted
MrHappyAsthma
Active Participant

Re: system exce command

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!
Mitchum
Member

Re: system exce command

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
MrHappyAsthma
Active Participant

Re: system exce command

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. Smiley Tongue  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!
Mitchum
Member

Re: system exce command

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
MrHappyAsthma
Active Participant

Re: system exce command

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. Smiley Very Happy

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!