LabView equivalent to running batch files using the "shell" command (VisualBasic)

I'm converting a VisualBasic app to LabView and am having trouble figuring out how to run a batch file with LabView.
The VB code that I'm trying to replicate is:
'UNLOAD RTX DRIVERS
Dim ProcessId As Long
ProcessId = Shell(App.Path + "\UnloadReloadRTX.bat", vbNormalFocus)
Wait 400
I haven't found a LabView equivalent to the Shell command. Any suggestions will be appreciated.
thanks,
Todd

It seems as if this question pops up every week. Use the System Exec.vi found under Funtions - Communications palette. It is the equivalent of Shell.
- tbob
Inventor of the WORM Global

Similar Messages

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • Running class files from the windows command line...

    Hello Everyone,
    My instructor showed us a way to run class files from the windows command line. However every time I try to run the class file from the command line using a command like: java CruiseHelper.class
    I get an error that states "Exception in thread "main" java.lang.NoClassDefFoundError: CruiseHelper/class"

    Hello Everyone,
    My instructor showed us a way to run class files from
    the windows command line. However every time I try
    to run the class file from the command line using a
    command like: java CruiseHelper.class
    I get an error that states "Exception in thread
    "main" java.lang.NoClassDefFoundError:
    CruiseHelper/class"Classes are not file names. You don't have a class named "CruiseHelper.class", that's a file name. The class name is just CruiseHelper (if you have no package statement in it).
    So,
    java -classpath . CruiseHelper

  • Export to PDF - Can a single report (rpt file) create multiple PDF files using the export command?

    Post Author: markeyjd2
    CA Forum: Exporting
    Greetings forum members,
    My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
    In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records.  When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
    What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record.  The file names would be based on the table's primary key.
    Is this possible?

    Post Author: Micha
    CA Forum: Exporting
    Hi,
    you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
    Here's an abstract of the ASP code I use:
    First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
      oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
    Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
    Micha

  • Version XI Cannot Find File USING VBA Shell Command

    I open Adobe Reader from an Access VBA Shell command.  After upgrading to Version 11, the Reader opens but I get the Error Message.  "Cannot Find File".
    This was on a Windows 7 Machine running MS Access 2012.  I had an older PX with XP and Access 2003 on it, so I ran the program on it with Version 10 and the Reader opened with the
    file passed to it using the Shell command.  I updated Adobe Reader to XI on the XP machine and I got the "Cannot Find File" message.  I went back to the Widows 7 machine anbd removed Version 11 and reinstalled Version 10 and the Shell command worked like it did before.  Does anyone know if there is a work a round for the Version 11 error as I have many many customers that may update to Version 11 and my program is not going to work for this particular function.
    Appreciate any help, thanks.

    Q1 Answer
    I use Shell because it has worked for years and it is a build in VBA function and ShellExecute uses Windows API, and I took the easy route.
    As I'm sure you know Shell is for exe, com or bat files and ShellExecute enables
    the opening of files such as txt, pdf... etc by file association.
    Q2 Answer
    The exact string is
    "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" C:\FoxFales Data\FoxFalesStaff\Alerts\GenericSupplies.pdf
    The path for AcroRd32.exe is retreived by reading the registry entry  "HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe\"
    Q3 Answer
    If you paste the above command in the CMD shell you get the same result.  Reader Opens, but opens with
    the message  "Cannot Find File".
    Newest Results
    In the forum I found threads that indicated that if in Security (Enhanced) you had "Enable Protected Mode At Startup"
    enabled there were some unpleasant results.
    So I turned it off and lo and behold Reader XI with the Shell commandfrom VBA works!
    But as a matter of interest I turned it back on and tried the API call ShellExecute, as you so politely suggested,
    and...IT WORKED with "Enable Protected mode At Startup" enabled.
    I don't understand why Reader XI lets ShellExecute work and not Shell, but I'm happy I  have a solution
    Thanks for you help

  • Problem wiht Running Batch File using Runtime.exec()

    I am writting one program which will create a jar file using a windows Batch file.
    The main program is in the folder "d:\CmdExec.java".
    The other one to which a jar file to be created is in the folder "e:\folder\HelloWorld.class"
    The contents inside the "e:\folder" are
    e:\folder\HelloWorld.class
    e:\folder\mainClass.txt
    e:\folder\run.bat
    The mainClass.txt contains "Main-Class: HelloWorld"
    The Run.bat file contains "jar cmf mainClass.txt HelloWorld.jar *.class"
    The coding for CmdExec.java is as follows
    import java.io.*;
    import java.awt.Desktop;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    Desktop desktop = null;
    if (Desktop.isDesktopSupported()) {
    desktop = Desktop.getDesktop();
    desktop.open(new File("e:\\folder\\run.bat"));
    catch (Exception err) {
    err.printStackTrace();
    When i double click the file e:\folder\Run.bat, it will create a jar file for HelloWorld.class.
    But, i want to create that jar file using the java program CmdExec.java.
    When i run CmdExec.java, the batch file is opened. But it shows error as "Can't find the specified file"
    But when i copy the following files to "d:\",
    e:\folder\HelloWorld.class
    e:\folder\mainClass.txt
    the jar file is created using the CmdExec.java.
    But,
    e:\folder\HelloWorld.class
    e:\folder\mainClass.txt
    these files should be in the folder"e:\folder" only.
    Can anyone Help me this Problem?
    Or Anyother way for creating a jar file for one program by using another program?
    Help me soon.............

    Try this. It's not running a bat file. You can say it almost is a bat file.
    import java.io.*;
    import java.util.Scanner;
    public class CmdExec {
        public static void main(String argv[]) {
            try {
                Process p = Runtime.getRuntime().exec("jar cmf mainClass.txt HelloWorld.jar *.class");
                Scanner s1=new Scanner(new InputStreamReader(p.getInputStream()));
                while(s1.hasNextLine())
                    System.out.println(s1.nextLine());
                p.waitFor();
                System.out.println(p.exitValue());
                if(p.exitValue()==0)
                    System.out.println("Okay");
                else
                    System.out.println("Error");
            catch (Exception ex) {
                ex.printStackTrace();
    }Run it in the same folder as mainClass.txt
    Edited by: ColacX on Aug 1, 2008 10:35 AM

  • How to run batch file using trigger?

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

    >
    the script will be started around 60-70 times a day
    >
    No - as marwim said the script will be executed every time the trigger is fired. And that trigger, depending on how it is written, might be fired several times for the same transaction.
    And if the trigger is fired the script will be executed even if the transaction that caused the trigger to fire issues a ROLLBACK.
    Triggers are non-transactional. You need to clearly define the business rules for when the script should run. Should it run only when the transaction is COMMITTED? Or should it run if the transaction executes even if the transaction performs a ROLLBACK?
    A trigger is the wrong solution for your problem.
    Please clarify what the business rules are that should control the execution of the script.

  • How to run batch files in the backround ??????

    please anyone tell me how to run the batch files in the background i dont want anyone to interfere the batch file..The batch file has to run for a long time even days so it will be safe if the batch file is running in the bachgroung somewhere ..
    please help me in this regards
    Thanking u
    Regards
    Santhosh

    The easiest way is to write a native application which starts the batch file in hidden mode (the target batch file could be an argument).
    Under Windows it would be done with the API call
    ShellExecute(NULL, "open", "C:\mybatch.bat", NULL, NULL, SW_HIDE);
    Then compile the native tool as windows application with no user interface. Now you are able to execute applications in invisible mode.

  • Error when importing Sample OBIEE Files using the IMPDP command

    I'm trying to follow the lengthy directions to create the Sample App, and I'm on page 7 of this installation guide:
    http://www.oracle.com/technetwork/middleware/bi-foundation/downloads/sampleapp107-deploymentguide-435786.pdf]description
    I've successfully completed the first 3 bullets on the page and I'm at the step of using the 'impdp' command to import data from the dmp file. The customized command I'm using is as follows:
    impdp sys/password@Eagle as sysdba directory=datapumpdir dumpfile=SASchemas.dmp version=11.2.0.0.0 schemas=BISAMPLE,OBIEE_NAVTEQ,BIFOD,BIBPM,DEV_ODI_REPO,ODI_STAGING LOGFILE=SASchemas_imp.log
    (Note that I'm using my actual password in place of 'password')
    Unfortunately, I keep getting the error: unknown command beginning "impdp sys/..." rest of line ignored'
    Why is this not working? I've checked the syntax very carefully.
    Thanks, John

    Whoops I was running this from the SQL Prompt and not the Dos Prompt... Never mind.

  • Saving a pdf file using the print command

    I'm having a problem saving a document to pdf using the print command. I'm using an old version of Adobe. it's Adobe Acrobat 6. it is giving me the following error The instruction at "0x775355b2" referenced memory at "0x775355b2". The memory could not be "read". Could someone please help me resolve this issue. Thank you.

    The OS and release version of the source file's authoring application have a significant impact on use of Acrobat 6.
    For example, Acrobat 8.1 is where Vista support begins.
    With MS Office, Acrobat 6 PDFMaker compatiblility is only for Office 97, 2000, XP, and 2003.
    Be well...

  • Running batch files using java

    Hi,
    How can i run two batch files in a specified interval(Eg. 1 hour) using java.
    Thanks

    Hi,
    Learn to Use the API.
    import java.io.IOException;
    import java.util.Timer;
    import java.util.TimerTask;
    public class RunBat {
         static void runBatchFiles(String[] batchFiles)
              final String[] files = batchFiles;
              Timer timer = new Timer();
              TimerTask task = new TimerTask()          {               
                   Runtime r = Runtime.getRuntime();               
                   public void run() {
                        for(String command : files)
                             try {
                                  r.exec(command);
                             } catch (IOException e) {                              
                                  e.printStackTrace();
              timer.schedule(task, 1000, 1000*60*60);
         public static void main(String[] args) {
              runBatchFiles(new String[]{"cmd /C start f:/one.bat","cmd /C start f:/two.bat"});
    }Thanks

  • Using a Variable to Substitute the path\filename of a Batch file in the Start_Process Command

    I am trying to write a script that will execute a batch file on a remote Windows server.
    This line below is basically what I'm trying to do and it works without error, however I would like to use a variable for the path\filename of the batch file.
    invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "\\qsc-a-ice01\D$\Test\RunThis.bat" }
    If I try to use a variable as in this example below I receive the error below. The error seems to indicate it's it expecting a "FilePath" parameter. Is this true? How would I change this script to make it work when substituting a variable.
    $MyProcess =  "\\qsc-a-ice01\D$\Test\RunThis.bat"
    Write-Host $MyProcess
    invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "$MyProcess"}
    This is the error text I receive when using a variable:
     PS C:\Windows\system32> D:\Test\ThisWorks.ps1
    \\qsc-a-ice01\D$\Test\RunThis.bat
    Cannot validate argument on parameter 'FilePath'. The argument is null or empty. Supply an argument that is not null or
    empty and then try the command again.
        + CategoryInfo          : InvalidData: (:) [Start-Process], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.StartProcessCommand
        + PSComputerName        : QSC-A-ICE01
    PS C:\Windows\system32>

    Mike,
    Thanks for providing the link, it was very informative. The link described how to use the args in a ScriptBlock and provided me with an explaination as to why it works the way it does on a remote server. This is my 1st post to the forum and I don't know
    how the points system works yet.
    I would like to split the points , but I don't see that this is possible.
    You're very welcome, I'm glad that the information was helpful.
    You can mark as many posts as answers as you'd like, there's not a restriction on only having a single answer per thread. You certainly don't have to though, David's answer is more than sufficient to help any future people who find this thread.
    Also, on a side note, you may want to post in the thread below. Posting there will get your account verified so you'll be able to post links and images.
    http://social.technet.microsoft.com/Forums/en-US/200c33c9-abe9-494a-953a-bf53fccb3c76/verify-your-account-11?forum=reportabug
    (Future people - don't use that link.
    Click here and look for the current thread as a sticky.)
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Run Batch file using GPO in all users with Windows 2008 R2

    Dear Sir,
    We have to install one software packages in all laptops using GPO. we have batch file and using this we can install software.
    is there any way to install automatic by this batch file?
    this is not msi packages.
    Regards,
    Sunil 
    SUNIL PATEL SYSTEM ADMINISTRATOR

    > Please provide how to configure...
    https://technet.microsoft.com/en-us/magazine/dd630947.aspx
    https://technet.microsoft.com/library/cc779329.aspx
    Greetings/Grüße,
    Martin
    Mal ein
    gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me -
    coke bottle design refreshment (-:

  • Applescript app to batch files using ffmpeg and command

    i'm not a technical person and i hoping that i can get a help to create a custom applescript app. i'd like to create an applescript app to run video files from any folder to encode (using ffmpeg) and save the re-encoded version in a new folder inside the current file folder. i found the script that i need to run inside the applescript:
    ffmpeg -i ORG-FILENAME -c:v libx264 -crf 27 -c:a libfaac -q:a 100 -map_metadata 0 NEW-FOLDER/ORG-FILENAME && touch -r ORG-FILENAME NEW-FOLDER/ORG-FILENAME
    i searched through the forum and found something that might work but my limited knowledge can't get this to work:
    on run
        tell application "Finder"
            set theFolder to (choose folder)
        end tell
        proceed(theFolder)
    end run
    on open theFolder
        proceed(theFolder as alias)
    end open
    on proceed(theFolder)
        tell application "Finder"
            set parentFolder to parent of theFolder as string
            if not (exists parentFolder & "A") then
                make new folder at parent of theFolder with properties {name:"A"}
            end if
        end tell
        tell application "Terminal"
            do script "for f in " & quoted form of POSIX path of theFolder & " do ffmpeg -i \"$f\" -c:v libx264 -crf 27 -c:a libfaac -q:a 100 -map_metadata 0 " & quoted form of (POSIX path of (parentFolder & "A")) & " \"$f\"
    done"
        end tell
    end proceed
    when i run this i get:
    for f in '/Users/admin/Pictures/0/1/' do ffmpeg -i "$f" -c:v libx264 -crf 27 -c:a libfaac -q:a 100 -map_metadata 0 '/Users/admin/Pictures/0/A' "$f"
    done
    macbookpro-7:~ admin$ for f in '/Users/admin/Pictures/0/1/' do ffmpeg -i "$f" -c:v libx264 -crf 27 -c:a libfaac -q:a 100 -map_metadata 0 '/Users/admin/Pictures/0/A' "$f"
    > done
    -bash: syntax error near unexpected token `done'
    can anyone help me please

    You are missing a ";"  after your path argument.
    for f in '/Users/admin/Pictures/0/1/'; do

  • Applescript MySQL interface (No... not using the shell command)

    I'm a windows guy, so please be gentle if I sound noobish.
    I'm trying to automate an export of the System Profiler info to a MySQL database directly, and I was hoping to get applescript to parse the info from the XML and push it into MySQL.
    Now I know that Applescript can manipulate MySQL by using shell commands for the MySQL command line client, but I was hoping that someone knew of a native applescript interface.

    There's MacSQL http://www.macupdate.com/info.php/id/21293 that will give an alternative route into MySQL. I don't know whether it's any better than using shell scripts.

Maybe you are looking for

  • Slow and insecure but feature-rich pacman wrapper in bash

    This project of mine started because I want to compile my packages in a way that lets me delete gnome apps. Here's the problem: I see that evince depends on gnome-keyring, gnome-keyring depends on gconf and alltray depends on gconf. This leads me to

  • Quick Time + Itunes Not working

    I upgraded my itunes to the new 6.0 version,And now It wont open. Ive tried to reinstall itunes again but still it wont work. Next i tried to open QuickTime and it only opens for 2 seconds and then closes. I think thats the problem,But i dont know ho

  • Questions in dbms_stats parameter

    Hello, I am using oracle9i. I have couple of questions when i read this help... http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1036461 I would appreciate if any one could answers my questions. Question1 ======= Method_opt

  • How to use the  FilterControllerClass with a sample

    Hi, I am having a sample for adding new parameters at runtime. However I need more info. What I try to accomplish what I want runtime, can be compared when using the CR designer, where you first add a parameter and then use the report record expert s

  • Appleworks won't open at all! help!

    Yesterday I was working on a word document and all of the sudden, I got the little spinning disk. I did a force quit and restarted my computer. Then, I go to open Appleworks and it doesn't do anything. I click the icon in the dock and it bounces up o