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.

Similar Messages

  • System exec cmd window

    Hello, first time posting a question!
    I have spent a good while trying to find an already posted answer to this, and looking on the wider web, hope i have not just missed it.
    I am using XP Pro SP3, LV 8.6.
    I am not very familiar with Windows command lines and structures etc. 
    I am using the System Exec VI to start a third party piece of software. I have wired the path in to the path input, and if i wire cmd /c start xxx to the command line terminal the VI will run and start the software application (xxx.exe). As the VI executes the cmd window clunks open and closed. If i run the VI without the cmd /c part of the command then an Error 2 is returned (as widely reported by others).
    Is it possible to open an application without the cmd window opening and closing?
    Using the System Exec VI it is possible to open NotePad just by wiring 'NotePad' to the comand line terminal. Is it possible to place the third party software somewhere, or register it with the OS somehow so it could be started in the same way as NotePad (i.e. without the cmd window flashing up)?
    Thanks...
    Blue 
    Message Edited by BlueTwo on 09-25-2008 09:22 AM

    Hi Thoric, thanks for the suggestions, Success!
    I tried the True boolean to the Run Minimized, but it did not help.
    Changing the Environment Path string to include the path to the directory containing the application did work (once i had worked out the syntax).
    On to the next problem....
    Cheers,
    Blue 

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

  • How does System Exec VI identify Standard Error within cmd code?

    I am using the System Exec VI to control a USB to serial adaptor program header, I have sucessfully written a .BAT file to call the CMD commands (the .exe I am running uses "-option" commands and the help file reccomends to do so) and it functions perfectly. My only issue is identifing errors. The "Standard Error Out" on the System Exec VI never outputs anything. Yes the wait until completion is TRUE and my standard output functions fine. I am curious as to how the System Exec VI  identifies errors from the command prompt and  why my errors are not showing up. I am currently using multiple match pattern string functions to identify the possible errors from my standar output for the time being but I would like to simplfy my code a bit and clean it up if at all possible. Not to mention there are most likely several other errors that could occur that I may have not identified. Some examples of stanadrd output errors i can get include include:
    {C:\Documents and Settings\owner\Desktop\RACK LINK>C:\DCRABBIT_10.66\Utilities\clRFU.exe "" -s "0":115200 -v -vp+ -usb+
    .bin not found
    C:\Documents and Settings\owner\Desktop\RACK LINK>pause
    Press any key to continue . . . }
    or
    {C:\Documents and Settings\owner\Desktop\RACK LINK>C:\DCRABBIT_10.66\Utilities\clRFU.exe "C:\Documents and Settings\owner\Desktop\RACK LINK\Calibration_v030.bin" -s "4":115200 -v -vp+ -usb+
    Rabbit Field Utility v4.62
    Installing Calibration v0.3.0
    Sending Coldloader
    Error: No Rabbit Processor Detected.
    C:\Documents and Settings\owner\Desktop\RACK LINK>pause
    Press any key to continue . . . }

    I think you should use error handling in batch programming, see this link http://www.robvanderwoude.com/errorlevel.php
    CLA 2014
    CCVID 2014

  • I am trying to use system exec vi to opens system 32 cmd.exec to do a net send over a windows nt network

    Is there a way to easily send strings over a local nt network, I am trying to use the net send command in windows nt cmd.exec using the system ecec vi, if anyone has any idea how to do this or more info on using the system exec vi in labview 6i. any info would be a big help
    thank you
    dale

    Yes it worked fine thank you, as long as I have your attention I noticed on one of your replies to a different question that you had written a vi that sends e-mail I was wondering if you could post me some info on this or any other communication vi's. just to let you know what I am doing " I am a summer student for electronics, and I have been given labview to write a program that monitors analog and digital channels and alerts a user if any "alarms vary" I am trying to notify the user of these changes by network, email, and pager. thanks to your last answer I have the network idea working.."
    thanks for your help thus far it makes learning these labview apllcations easier
    Dale Walker

  • CMD.exe is still running after System Exec.vi

    Hi,
    I'm currently trying to use the System Exec.vi to launch files and applications by writing the action to do in a constant bat file and calling this bat file( to avoid synthax problems). I've remarked that a cmd process is active while the file or application launched previously is opened. It uses more CPU and sometimes disables the new cmd command passed.
    I've already tried to change the wait until completion constant but, in every case the cmd process only stops when we stop the process it had launch.
    I'd like to know if it's possible to avoid this multiple cmd by killing ther cmd window after it has complete its task?
    I'm looking forward to your answer.
    Thank you in advance.
    Bim

    Please see the link below:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=79683&requireLogin=False
    It should solve your problem
    Regards,
    Sanaa T
    Sanaa T.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> http://www.nidays.fr/images/081110_ban_nidays09_468X60.gif

  • How do you change the directory of system exec after it has ran once in the current vi

    Hi all,
    Attached is the sub vi that i am running in my main application.  I run it twice and change the directory of the file to run.  It appears that after i run this vi that i cant change the directory and it tries to run a file from the incorrect directory.  Does anyone have any advice on how to fix this issue?
    Attachments:
    system execute command.vi ‏41 KB

    matt198717 wrote:
    Hi all,
    Attached is the sub vi that i am running in my main application.  I run it twice and change the directory of the file to run.  It appears that after i run this vi that i cant change the directory and it tries to run a file from the incorrect directory.  Does anyone have any advice on how to fix this issue?
    I am not sure, if I understand exactly the problem, but do you really need the cmd /c start some_executable.exe. This executes a command prompt window, which executes another command prompt window, where your executable runs.
    You can just use cmd /c some_executable.exe some_parameters_if_needed, and you don't need any quotation marks, even if the executable has command line parameters. I you want that the executable runs in particular directory, wire this path to the 'working directory' of System Exec.vi

  • Windows system exec error in application causes app to crash

    The basics:
    LabView 11.0 (32-bit)
    Windows 7 enterprise
    Because I have to control an elevated app I run my built app elevated on a Win7 64 machine.
    I have an application that uses the system exec.vi (attached) to get a portion of the arp table. When I run this in development it works great. However when I build an app and run it this vi causes the app to be unstable and crash.... sometimes. I have a troubleshooting vi that I wrote that I place at the start and end of vis. This puts a log file on my desktop so that I can trace where it crashes. I've attached the log as well.
    Basically we have a power controller that we control by Telnet but 1st I have to get the IP. I have the MAC of the controller which is DHCP but not the IP. To get the IP I fill the ARP table and search it for the MAC.
    get ARPCache.vi throws the error messaage: System Exec.vi . Command was "cmd /c "arp -a | find "192.168.120"" but only in the built app.
    Update: While getting more info to complete this post I did a build where I changed "get ARPCachs.vi" to show when called so I could see the error cluster. Now it pops up but no errors. hmmm
    Norm
    Attachments:
    get ARPCache.vi ‏22 KB
    Log program message start finish.vi ‏24 KB
    Program Log.txt ‏2 KB

    It depends on how the exe deals with the arguments. Some do honor escape characters, some not.....
    Afaik, there is no difference regarding the System Exec in development environment vs. exe. But it is possible, that these are executed using different user rights?
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • System Exec output

    The example below ilustrates the problem I'm having.
    What I want to do is run an Executable, Wait until done.
    But the issue I have is when I run the wait until done with the flag to True the output is blank until it completes.
    When I runn it with the flag off I can see that my process is putting output to the console.
    Anyone knows how to Wait Until Done True and still see the progress of the process while it's still working?
    Thanks,
    Maciej
    Attachments:
    CommandLine.zip ‏13 KB

    Hi Smercurio,
    Thanks for that ... I did stumble upon that post and I appreciate you puttning down an example there on how to use the WinAPI.
    I've seen your example too which does seem to work to some extent but for example I've notided that you cant move or resize the command windonw now using your method ... and I simply got annoyed so I gave up.
    I think I'm just going to go for launching the the CMD silently and reading the console out either with WIN API or by reading an output file and I'll mimic the console in a LV textbox.
    I just wanted to knock up something up for a meeting I have in a few hours to present this ... and I didn't want to use a workaround which might have an issue it.
    Havent tried out the Open G yet ..but I'm low on time so I'll inspect all avenues when I get to implement the CMD line feature properly.
    I posted here in the hopes of getting an answer on how to get this to work without workarounds but it seems that it is just how the System Exec Feature is designed.
    Thank you,
    Maciej 

  • Labview 5.0's system exec vi

    Anyone know of a better VI than "exec" to run a dos program.
    The problem is, that the exec vi does NOT wait for it to complete.
    I can see that its being called but it doesnt allow it to finish.
    The use of a wait VI did not do anything, since the dos window
    is already closed at that point.
    Eric
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    The following has been tested on NT5.0 only:
    When executing something from the command line use:
    C:\>cmd.exe
    Using the system exec VI feed in "cmd.exe".
    Then follow it with the command you want to perform. Some notes:
    /C Carries out the command specified by string and then terminates
    /K Carries out the command specified by string but remains
    /? Get help on this command
    Use the "|more" command to page the information.
    THANK YOU
    Michael Aivaliotis
    Senior Test System Design Engineer
    Microsys Technologies Inc.
    Tel: 905-761-5250 Ext.22
    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: August 4, 1999 5:44 PM
    To: [email protected]
    Subject: Labview 5.0's system exec vi
    Message f
    rom the Deja.com forum:
    comp.lang.labview
    Your subscription is set to individual email delivery
    Anyone know of a better VI than "exec" to run a dos program.
    The problem is, that the exec vi does NOT wait for it to complete.
    I can see that its being called but it doesnt allow it to finish.
    The use of a wait VI did not do anything, since the dos window
    is already closed at that point.
    Eric
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.
    Deja.com: Share what you know. Learn what you don't.
    http://www.deja.com/
    * To modify or remove your subscription, go to
    http://www.deja.com/edit_sub.xp?group=comp.lang.la​bview
    * Read this thread at
    http://www.deja.com/thread/%3C7oac6b%242j6%241%40n​nrp1.deja.com%3E
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

  • Why does system exec cause a memory leak to occur?

    Sorry if this has been posted before, but I can't quite figure out why this VI is causing a gigantic memory leak (losing nearly 500K of memory a second). It's a simple system exec call, and I even trivialized everything in order to try and discover the problem.
    Does anyone see a huge problem here? I've tried calling up taskkill afterward as well, though that seemed to make little difference.
    If you don't trust my trivial program (and you probably shouldn't), I've also included the source files for the program - it's a one-line C++ program that returns immediately.
    Any insight is greatly appreciated.
    Thanks!
    Attachments:
    Dilution.vi.zip ‏11 KB

    Try putting a wait - even a 0 second wait - in your loop and see if it makes a difference.  Without a wait, LabVIEW will try to run that loop as fast as possible, possibly so fast that it never yields time to free resources.

  • 1142N unable to open Web GUI and CMD line options not available

    I am currently trying to configure two 1142N APs (AIR-LAP1142N-A-K9) to be stand alone APs. I have followed the PDFs
    http://www.cisco.com/en/US/customer/docs/wireless/access_point/12.3_8_JA/configuration/guide/s38frst.html#wp1103248
    and
    http://www.cisco.com/en/US/customer/docs/wireless/access_point/12.3_2_JA/configuration/guide/s32frst.html#wp1103310
    I set up the switch to provide DHCP and confirmed that each AP is indeed assigned an IP address. I can also ping each device. However when trying to browse to the GUI it fails to connect. So I tried to configure it via the CMD line. The enable mode does not give the option to configure interfaces as you would expect in enable mode nor does it give the option to enter global exec. example of the out put below.
    AP8843.e178.0ee0>
    AP8843.e178.0ee0>enable
    Password:
    AP8843.e178.0ee0#?
    Exec commands:
      cd               Change current directory
      clear            Reset functions
      clock            Manage the system clock
      crypto           Encryption related commands.
      debug            Debugging functions (see also 'undebug')
      delete           Delete a file
      dir              List files on a filesystem
      disable          Turn off privileged commands
      enable           Turn on privileged commands
      exit             Exit from the EXEC
      fsck             Fsck a filesystem
      help             Description of the interactive help system
      led              LED functions
      lock             Lock the terminal
      login            Log in as a particular user
      logout           Exit from the EXEC
      lwapp            lwapp exec commands
      mkdir            Create new directory
      monitor          Monitoring different system events
      more             Display the contents of a file
      name-connection  Name an existing network connection
      no               Disable debugging functions
      ping             Send echo messages
      pwd              Display current working directory
      release          Release a resource
      reload           Halt and perform a cold restart
      rename           Rename a file
      renew            Renew a resource
      rmdir            Remove existing directory
      send             Send a message to other tty lines
      set              Set system parameter (not config)
      show             Show running system information
      systat           Display information about terminal lines
      terminal         Set terminal line parameters
      test             Test subsystems, memory, and interfaces
      traceroute       Trace route to destination
      undebug          Disable debugging functions (see also 'debug')
      upgrade          Upgrade software
      verify           Verify a file
      where            List active connections
    It seems that the IOS on this device does not have the capability to configure the AP as stand alone or that it has been disabled. How do I get into the CMD line to configure the AP for deployment?
    Secondly since I could not configure it via the CMD line I attempted to connect to it via the GUI like I said above. This fails. I ran an NMAP to find out what is open and found that nothing but port 23 is open. What is the deal here? Is the web GUI shut off by default? Am I just totally missing something? I think I dies a little inside after this...help please?

    AP8843.e178.0ee0#sh ver
    Cisco IOS Software, C1140 Software (C1140-RCVK9W8-M), Version 12.4(18a)JA, RELEASE SOFTWARE (fc4)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2008 by Cisco Systems, Inc.
    Compiled Fri 21-Nov-08 01:28 by prod_rel_team
    ROM: Bootstrap program is C1140 boot loader
    BOOTLDR: C1140 Boot Loader (C1140-BOOT-M) Version 12.4(18a)JA3, RELEASE SOFTWARE (fc1)
    AP8843.e178.0ee0 uptime is 2 hours, 16 minutes
    System returned to ROM by power-on
    System image file is "flash:/c1140-rcvk9w8-mx/c1140-rcvk9w8-mx"
    This product contains cryptographic features and is subject to United
    States and local country laws governing import, export, transfer and
    use. Delivery of Cisco cryptographic products does not imply
    third-party authority to import, export, distribute or use encryption.
    Importers, exporters, distributors and users are responsible for
    compliance with U.S. and local country laws. By using this product you
    agree to comply with applicable laws and regulations. If you are unable
    to comply with U.S. and local laws, return this product immediately.
    A summary of U.S. laws governing Cisco cryptographic products may be found at:
    http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
    If you require further assistance please contact us by sending email to
    [email protected].
    cisco AIR-LAP1142N-A-K9    (PowerPC405ex) processor (revision B0) with 98294K/32768K bytes of memory.
    Processor board ID
    PowerPC405ex CPU at 586Mhz, revision number 0x147E
    Last reset from power-on
    LWAPP image version 3.0.51.0
    1 Gigabit Ethernet interface
    32K bytes of flash-simulated non-volatile configuration memory.
    Base ethernet MAC Address:
    Part Number                          :
    PCA Assembly Number                  :
    PCA Revision Number                  : A0
    PCB Serial Number                    :
    Top Assembly Part Number             :
    Top Assembly Serial Number           :
    Top Revision Number                  : A0
    Product/Model Number                 : AIR-LAP1142N-A-K9
    Configuration register is 0xF

  • 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 use System exec.vi...

    hi,
    i want to run a shortcut from a labview application. i know the command line to do this from MS DOS but i don't understand how works System exec.vi.
    Could you help me giving some example?
    Thank you

    Use the command "start <path to shortcut>", or "cmd <path to shortcut>", as explained in this document.
    Message Edited by smercurio_fc on 06-08-2007 09:46 AM

  • Launching an app via system exec behaves differently to launching it outside LabVIEW

    Hi,
    My problem is as follows:
    I am trying to write some code to communicate with an Anritsu unit (MT1810A chassis with MU181020A plug-ins) via ethernet.  Anritsu supply a standalone app to control this instrument (MX180000A.exe) which gives comprehensive control over the setup & config of the instrument.
    I want to control this unit via LV however without recourse to their program.
    The only time that either MAX or LV seem to be able to successfully communicate with the unit is when the supplied Anritsu app is running.  Not only that, the app must be opened manually, ie by clicking on the exe (or selecting it from the Start --> Programs etc menu) or using cmd prompt with exe path.  Once the app has been started this way, MAX can talk to the unit and any LV code executes without error.
    If however I use the system exec vi within LV to launch the Anritsu app, the app opens as normal, is able to control the unit however MAX now has an exclamation mark on the VISA resource - status shown as:
    VISA returned this static device when finding resources, and MAX could use VISA to parse the resource name. MAX could not succesfully open a VISA session to the device.
    and it can no longer talk to the unit.  In addition any LV code now generates the following error when trying to open a VISA connection to the unit:
    Error -1073807343 occurred at VISA Open in BER Initialize.vi
    Possible reason(s):
    VISA:  (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.
    So, getting to the point -
    - Why the difference in behaviour depending on how the app has been opened?
    (oh and of course, how do I fix it? )
    Regards
    Andy
    System is running XP, LV version 8.5, VISA 4.2
    Unit needs to be added to MAX using manual entry of raw socket, ie
    TCPIP0::192.168.1.21::5001:OCKET
    There are 2 network cards in the PC.  The unit is connected to card 2 which has been specified as the default in the network control panel.

    Hi,
    Here is a KnowledgeBase article that might help concerning the error you're receiving. Do you see this behavior on multiple PCs as well?
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

Maybe you are looking for

  • Critical Error while saving a workbook as local spreadsheet

    Hello, We have recently upgraded from BW 3.5 to BI 7.0 and users are intermittently experiencing problems when trying to save a BI workbook as a local spreadsheet file. Sometimes when they try several times eventually they are able to save it other t

  • Making a PDF with "Outline" and Bookmarks Using Pages

    Hi, I'm using Pages 1 and I have tried making a PDF with outline breaks but I failed. I thought using paragraph styles for my document would work but when I exported my document to PDF, all I got was a PDF that only has the thumbnails view but not th

  • Issue at PSA Level data

    Hi, I am trying to extract data from the 0CRM_COMPLAINTS_I into BI. I have to enhance this DS with two Z fields. I can clearly see data populated for these Z fields in RSA3 with the enhancement code. When I tried to get the same into BI, the data is

  • Flex app can't connect to the internet / server when uploaded?

    I made a simple app that submits a data via POST using the HTTPService. My problem is, when I Run the application from the Flash Builder IDE, and it opens in the browser as a local file, it interacts with my server (remote server) without any problem

  • Doubt in output of  Report 'Hello World'....

    Hi.. I copied report 'hello world' from abapdocu and executed it...I have created d screen and set d attributes similar to d report but when i click on the pushbutton i.e. next i don't get any output. Where is d mistake? Plz reply... Thanks!