Execution of shortcuts with System Exec?

Is it possible to execute a shortcut (typical named "Shortcut to nnnn") with System Exec.vi?

No it isn't because shortcuts are not executable. Shortcuts are files which can be interpreted by the windows explorer.
You can run a shortcut via the shell execute function. Attached is a VI which will call this function. In "Dateiname" you have to supply the filename with extension. In "Verzeichnis" you have to supply the folder where the file is. You can set the verb to "open" which will run the application and "print" which will cause the application to print the file if it can. "Rückgabe" is the return from the shell execute function.
You can use each file extension to start the registered application for the file. If you give a file with the name Test.vi you will start LabVIEW in the same way you will start it like you have double clicked th
e file in the explorer.
Waldemar
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Attachments:
ShellExecute.vi ‏114 KB

Similar Messages

  • General Inquiry Regarding Error Handling with System Exec.vi

    I have a sub vi that uses the System Exec.vi to send SMS messages when triggered. I am confused as to how the error handling works and why all of the errors seem to go to the "standard error" vs the "Error out". The reason I am interested is because I am trying to interrupt the error out of another script to execute a command if error=true.
    I have intentionally created an error to test this, however it does not seem that the signal is ever being sent to the error out, only to the standard error.
    Any help/explanation as to how this works would be greatly appreciated.

    The Facebook discussion board is just a pilot and that functionality is not available yet (as to my knowledge). You will have to use the actual forum thread to add attachments. You can click the arrow just to the right of thread topic in the Facebook thread and that will take you to the ni.com/forums thread. Or you can navigate here:
    http://forums.ni.com/t5/LabVIEW/General-Inquiry-Regarding-Error-Handling-with-System-Exec-vi/m-p/246...
    Having a look at your VI would help to clarify the error handling issue.
    Daniel K | NI Applications Engineer | Certified LabVIEW Developer

  • Run a program with system exec.vi

    hi
    I've got a problem with system exec.
    When I launch a simple program like :  c:\windows\notepad.exe it works very well.
    But when I launch a program with parameters, it doesn't.
    here is the command line:   c:\bmd.exe a.bmd a.txt ffffffff ffffffff  
    When I put this command line in a cmd windows it works perfectly. It don't understand...
    Any idea?
    Attachments:
    Sans titre1.JPG ‏22 KB

    Hi Julesjay,
    I found out that if the command string didn't include the path of the executable (start) the program would fail (at least with matlab executables) So make sure the path of the exe is included in the command string.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How to capture keyboard strokes while focus is on an external app. Opened with system exec

    Hi to the Forum,
    I have an application that runs an external app. Through system exec, while this application is open the user needs to input a 6 digit serial number using the keyboard, I need to capture in parallel that information on my main VI in order to perform some information validations, such as the six digits were entered, the serial number is not repeated etc. I have read other post about the same issue but did not found a practical way to achieve a solution, please help with an example of how to do that as I'm on the final stage of the project.
    Thanks in advance for your time and help.
    MRDK

    Hi MRDK,
    You can/have to use Connectivity>>Input Device Control palette functions.
    Attached is the simple example.
    Regards,
    Yogesh Redemptor
    Regards,
    Yogesh Redemptor
    Attachments:
    Get Keyboard Event.vi ‏15 KB

  • Close a notepad window in labview after opening it with system exec

    Is there a way to close a notepad window within Labview after opening the window using the System Exec function?
    Also can Labview send characters to Notepad so they show up in its window?

    You can send a quit message to another window by using one of the VIs in a collection of windows interaction VIs called winutil32 (or something similar), but you will have to know the window name. Try searching for it on this site.
    You could probably also use the windows PostMessage function to send characters to another window, but that would require learning how to work with DLLs in LV, reading up on the function at the MSDN site and implementing it. Another, more simple but less secure, way is to use the windows Keybd_Event function to simulate keyboard clicks. If the notepad window has the focus, it will receive those clicks. Try searching this site or google for things like "Keybd_Event LabVIEW" or "simulate keyboard".
    Try to take over the world!

  • How to Launch a "setup.exe" with LabVIEW app? No luck with System Exec.vi

    I've got an application that I'm trying to update with a separate LabVIEW application (the "Updater"). It's the "Check for Updates" capability you see on other major apps.
    Here's the glitch: When the Updater tries to launch "setup.exe" using "System Exec.vi", The installer seems to catch the attempt and pops a dialog titled "Windws XP Setup" saying "Please go to the Control Panel to install and configure system components".  The install does not begin and the installer closes (if it was ever open!).
    Running the same installer by double-clicking the "setup.exe" file from windows runs just fine.
    Here's the question: "How can a LabView app launch an installer?" 

    Could you show the code.
    Look at the path where you want to run the code.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Why I get an error when I call Snipping Tool with System Exec?

    Hi to everyone, I want to call Snipping Tool from LabVIEW using the System Exec VI, but I always get an error 2; this not happen when I call another executables like calculator or paint; I hope someone can help me or tell me why this error occurs.
    Thanks in advance, I have attached a couple of images of the VI that I have done so far.
    Solved!
    Go to Solution.
    Attachments:
    block diagram.PNG ‏11 KB

    Hey there ;
    I am guessing you are using the command: SnippingTool or SnippingTool.exe, just as you would use mspaint; but it is giving you Error 2; this is a Windows Issue more than a LabVIEW one, ,you can try using command:
    C:\Windows\Sysnative\snippingtool.exe;
    it worked for me; i found this info in the KB below.
    Command Not Recognized When Using System Exec VI
    Good luck

  • Problem: Using "msg" command with "System Exec.vi"

    I'm attempting to write some LabView code that takes advantage of the "System Exec.vi". At the moment, I've tried using it to ping machines, return the ipconfig and run through the example code that NI provides.
    I would like to use the "msg" command used on Windows operating systems to send out a message to multiple machines on our network at once. Warning them we're about to update a program and they should log-off, things like that.
    I tried using the "msg" command in LabView keeps returning errors. I also wrote a quick batch file as follows:
    @echo on
    cd c:\Windows\System32\
    msg.exe /server:localhost * test
    When I launch the batch from windows, it executes. When I launch it from LabView (using the System Exec.vi) it fails.
    Potential Quirks:
    I discovered in a different location that in order for a machine to receive these messages they need to have a registry entry in:
    "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" and have a DWord called "AllowRemoteRPC" = 1.
    Note that "/server:localhost" could be "/server:anycomputer" and the " * " is used as a wildcard which sends a message to anyone who is logged onto that machine. Also note that "test" is the message to be sent.
    Any ideas why I'm having a problem?
    tl;dr: "System Exec.vi" won't run the "msg" command. Why is this?
    - Mike
    ~~~~~~~~~~~~~~
    Current Setup:
    LabView 2010
    Windows 7
    Solved!
    Go to Solution.

    -> What versions of labview and windows are you on?
    LabView 2010 and Windows 7.
    -> Have you ever sent any commands out, or is msg the only one you've tried so far?
    I've successfully used the 'ping' command and also returned a standard 'help' command to LabView.
    -> Finally, in tools>>options, you may need to change your access settings under VIserver and Webserver.
    My VI server settings are allowing everything except "Show VI Scripting Functions, properties and methods"
    I have nothing configured for a web server, since I didn't plan on using it for this. Unless it has some sort of connection that I am missing.
    I'm attempting a work-around where LabView will generate a batch file to run from the desktop instead, since it seems that something is getting lost in translation between LabView and the command-prompt.
    - Mike
    ~~~~~~~~~~~~~~
    Current Setup:
    LabView 2010
    Windows 7

  • Open a *.exe applicatio​n in LABVIEW with system exec function.

    Greetings,
    I would like to be able to lauch a *.exe application and open a specific file within my labview vi. The trick is to avoid using active X control at all cost. I would like to use the system exec function but I couldn't quite get it to work.
    Let's assume that I would like to lauch wordpad.exe from my local drive. What are the params I need to pass? Thanks.

    You have to type in the command line of the System exec vi the name of the executable and eventually its path.
    Look at the attached vi that launches Wordpad as you asked.
    Attachments:
    wordpad_exec.vi ‏72 KB

  • PsExec.exe Runing on labview2012 with System Exec.vi

    I have problem on this,it report erroe to run PsExec.exe using "System Exec.vi". It runs well on Labview8.6 version,but has problems on Labview2012. Could someone give some help?
    Solved!
    Go to Solution.

    Should this works?but it report the error
    Attachments:
    untitled.JPG ‏37 KB

  • 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?

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

  • System Exec v. Cmd line differences

    From the DOS command line, I can start an external program; tell the program a file to open; and activate some switches.  From system exec, the program can't find or open its open file, althougth the error seems to have the correct file name.  What could be the problem? I've tried all sorts of variations in configuring the LV code.

    The thing you have to remember is that System Exec is really more like using the Start -> Run command. It is not the same as having a command window open. Thus, if you cannot enter a valid command via Start -> Run, then your command will not work with System Exec as is. Usually you can use cmd /c or cmd /k as suggested to get the command window "environment". In some cases you need to resort to a batch file to get it working.

  • How to keep "System Exec" section open

    Hi,
    I use "System Exec" to launch a Python script.  The script launched successfully, however, the System Exec also ended.  There are many environment settings done by this Python script so I want to keep the section open for subsequence Python scripts/commands.  Could this be done with "System Exec"?  If not, what is the easy way to do this.  Some example would be great.
    thanks,
    -a

    Have you tried LabPython?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Calling a VI which uses "system exec.vi" with LabVIEW run-time engine as adapter

    Hi,
    My TestStand sequence calls a VI which includes a call to "system exec.vi". When I try to load it in TestStand and if LabVIEW adapter is set to run-time engine, I get an error message "Unable to load Vi...". If I switch the adapter to "Development system", then it works fine.
    Is there any way to use "system exec.vi" in a VI which is called in TestStand with LabVIEW run-time ?
    Thanks,
    Alex
    Solved!
    Go to Solution.

    Hi Alex,
    In you case, you are getting a -18002 error.
    The reason is explained in the following link:
    -18002 Errors in TestStand
    http://digital.ni.com/public.nsf/allkb/D82FEAF0B4BA293A862575710053E252?OpenDocument
    Please have a look at the 2nd reason. This is your case.
    Hope it helps,
    Regrads
    Julien De Freitas / Applications Engineer / Certified LabVIEW Developer (CLD)
    National Instruments Switzerland

  • Sand Box has stopped working error when using System Exec.vi with wait until completion is true

    I get the following error message in Windows 7 "Sand Box has stopped working" when using System Exec.vi with wait until completion set to true, if I set it to false there is no error message.

    Hello JJVerdi
    mmm well System Exec.vi simulates a DOS command window, can you run the sandbox from the cmd window using the same commands without any errors? 
    you may take a look to this KB, it may be related to your issue:
    http://digital.ni.com/public.nsf/websearch/2393462​BD57B854186256C4F007B706A?OpenDocument
    Regards
    Mart G

Maybe you are looking for