Xcopy without a command window....

Hi,
I need to download from the network a folder, not always the same folder as this will hopefully be pragmatically controlled, along with its sub folders, if present.
As far as I can see the best option is xcopy, with its switches, or is there another option?
Err = system ("xcopy /S/Q/Y/R/K \\\\NW_Drive\\Test_Fol\\TestDataSource\\Rel\\TestC​ode\\*.* C:\\Test_Loc\\test\\SRM\\");
If it is to be xcopy can it be done without a command window or at least a small or minimized command window?
Thanks for the help
Simon
Solved!
Go to Solution.

You may want to explore LaunceExecutableEx possibilities, especially for its ability to hide the launched program window. Keep in mind that this is an asynchronous call, so if you want to survey the process you need to save the handle returned by the command and periodically check its state with ExecutableHasTerminated () function.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Run a jar on Windows without the command window

    I would like to run a jar and close the command window after starting up. Is this possible please.

    I would like to run a jar and close the command window after starting up. Is this possible please.why do you want to do that? jar files are executable files so when you double click it, it will execute without having to run it from the command prompt. So, you don't have to even open the cmd prompt to run .jar files.

  • How do you make a stand-alone app work without seeing a command window...

    I'm new to Java so please forgive the very basic question I'm asking. All the apps I've learned how to make so far cause a command window to appear along with the GUI. How do you keep the command window from showing up?

    java ExampleApp
    I just discovered using the search for this site. I should know better than to make a post without first using the forum's search. It's just that I had been searching the java tutorials already to no avail as well as using a search engine.
    According to the forum here, people have said that you need to create a .jar file. I'll need to look into the specifics. Sounds a bit confusing at first. There was also mention of starting the app like so:
    javaw ExampleApp
    I'll go try that now! Any other suggestions you may have will be appreciated!
    Thanks,
    Darren

  • XCOPY and ROBOCOPY commands are OBSOLETE?

    Okay, I've talked to a couple of TechNet Support Agents and scoured google, bing, and the TechNet forums to no avail.
    Apparently, my situation is so different that it's impossible to fix unless I use some sophisticated script and such.
    My problem:
    I need to copy all the folders in a Directory, while excluding everything else (e.g. subfolders and files). In basic terms, just need empty folders with names of all the folders you would see in one directory, and by "folders" I mean just the ones
    you see in the root level of that directory. In layman terms, I want all the main folders from one folder (without their contents) copied to another.
    Apparently, xcopy and robocopy commands are somewhat broken in Windows 8.1
    Also, I'm not going to be making a new folder of each from scratch, because there's about a hundred of them and each have long names to type in. As for subfolders, there's about 5k of them which is what I'm trying to avoid (not sure if mentioning this
    is relevant or not).
    the xcopy /t command still copies all subfolders (of course /xf * is needed but I need something else for the subfolders). Robocopy /LEV:0 or 1 doesn't do jack for avoiding subfolders either.
    I wonder if there's a script someone knows about that I can use with a batch file to do what I want?

    Never mind, I solved my problem after reading about a similar issue on superuser.com
    It turned out to be a robocopy command combination: robocopy [source] [destination] /e /create /lev:2 /xf *

  • AppleScript: How to reload a Safari window without bring the window to the foreground while I am on other Desktop space

    I want to write an AppleScript to achive a simple task. That is, I open a Safari window on Desktop 1 and automatically reload every 30 minutes while I do my dialy work on desktop 2.
    Here is my script:
    tell application "Safari"
        activate
        tell application "System Events"
            tell process "Safari"
                keystroke "r" using {command down}
            end tell
        end tell
    end tell
    This script works. However, whenever the script is executed, my current Desktop 2 will be brought back to Desktop 1. It is distracting to my workflow.
    Is there any way to just let Safari to reload in the background without bring Safari window to foreground on Desktop 1?
    I have done a coumple of researches; many of them say I should not use "activate" in my script. I tried that but then the script will just do nothing.

    Hi, Hiroto
    your approach works perfectly fine. Thank you.
    I just found there is also a more generic approach without tweaking of javascript or any third party scripting language involed:
    #!/usr/bin/osascript
    tell application "Safari"
        set docUrl to URL of document 1
        set URL of document 1 to docUrl
    end tell
    From there, I can do a simple cron job task now.

  • Running a GUI application without holding command prompt

    Hi there ,
    I have developed a GUI application using Swing. After compiling the same successfully , when I run the same , presently , I am running it like ,
    c:\> java xxx
    where c:\ is the general command prompt on a Windows machine where I can type in my commands like javac or java and xxx is the class file name . Now till I complete using my GUI application and exit from the same , the command prompt will also be there ( and probably displaying the output of my System.out.println ) . So , two sessions are running , one is just the command prompt and another is the actual GUI application.
    How can I avoide this ? e.g. when I type command "notepad" and press enter , notepad is started and the command prompt returns after starting notepad i.e. the notepad and the command prompt are not related now , I can close the command intrepreter and still notepad is running . What should I do to create such a Java GUI application ? Please advice .

    If I understand you correctly this is something that happens in linux also. And I believe that you can solve this by creating to shortcut to this program.
    And the shortcut or link to application will be the command line that you use to run the Java Application.
    i.e.
    java c:\javadir\subjavadir\application.class
    And I believe that this will allow it to run without the command prompt. Just showing the GUI and no additional command prompt window. Freeing the command prompt is something that I don't know how to do in either OS.
    I use the Link To Application method because I ultimately don't need to have multiple windows for one application. Even though it is nice to be able to kill the Application by destroying the command-prompt session (in case your app causes lock-ups during testing).
    Post your results . . . I'm not even sure that I'm being clear at all with my explanation to your question.

  • Output jframe information to command window

    Hi all I have a program that tracks the assets of a customer, kind of like a cart that holds cds, appliances, etc...
    I wanted to be able to print out the results to the command window after they enter the number of how many items from what the user enters after they press "current status" or if they "delete" their current items. I want it to keep doing this until they close the window and exit the program. People have told me to add the System.out.println to where it says "delete" or "current status" but Im not sure how to add it in I will attach the code here. Thanks
    import java.awt.Color;
    import java.awt.GridLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class TestProgram extends JFrame implements ActionListener{
       JLabel column1, column2;
       JLabel totalItems, totalCost;
       JLabel serialNum;
       JLabel electronics, autos, furnitures, cds;
       JButton TrackAssets, delete;
       JPanel panel;
       JTextField electronicsAsset, autosAsset, furnituresAsset, cdsAsset;
       JTextField serialNumber;
       JTextArea items, cost;
       // constructor to initialize the top variables/fields
       public TestProgram()
             column1 = new JLabel("Select Items");
         column2 = new JLabel("Specify Quantity");
         electronics = new JLabel("Electronics");
         electronicsAsset = new JTextField();
         electronicsAsset.addActionListener(this);
         autos = new JLabel("Autos");
         autosAsset = new JTextField();
         autosAsset.addActionListener(this);
         furnitures = new JLabel("Furnitures");
         furnituresAsset = new JTextField();
         furnituresAsset.addActionListener(this);
         cds = new JLabel("Compact Discs");
         cdsAsset = new JTextField();
         cdsAsset.addActionListener(this);
         serialNum = new JLabel("Serial Number input here");
         serialNumber = new JTextField();
         electronicsAsset.setNextFocusableComponent(serialNumber);
    //Create labels and text area components
         totalItems = new JLabel("Total Items:");
         totalCost = new JLabel("Total Cost:");
         items = new JTextArea();
         cost = new JTextArea();
    //Create buttons and make action listeners
         TrackAssets = new JButton("Current Status");
         TrackAssets.addActionListener(this);
         delete = new JButton("Delete all");
         delete.addActionListener(this);
    //Create a panel for the components
         panel = new JPanel();
    //Set panel layout to 2-column grid
    //on a white
         panel.setLayout(new GridLayout(0,4));
         panel.setBackground(Color.white);
    // add details
         getContentPane().add(panel);
         panel.add(column1);
         panel.add(column2);
         panel.add(electronics);
         panel.add(electronicsAsset);
         panel.add(autos);
         panel.add(autosAsset);
          panel.add(furnitures);
          panel.add(furnituresAsset);
          panel.add(cds);
          panel.add(cdsAsset);
         panel.add(furnitures);
         panel.add(furnituresAsset);
         panel.add(totalItems);
         panel.add(items);
         panel.add(totalCost);
         panel.add(cost);
         panel.add(serialNum);
         panel.add(serialNumber);
         panel.add(delete);
         panel.add(TrackAssets);
       public void actionPerformed( ActionEvent event ){
                 // variables for method actionPerformed
                 String output, output2;
                 Object source = event.getSource();
                 Integer electronicsNo, autosNo, furnituresNo, cdsNo, serialNum;
                 // class responsible for showing different items
                 AssetTracker tracker = new AssetTracker();
                 Double cost;
                 // program is instance of TestProgram creates a new file
                 TestProgram program = new TestProgram();
                // if they track assets...
                if(source == TrackAssets){
                  tracker.serialNum = serialNumber.getText();
                  tracker.electronics = electronicsAsset.getText();
                  tracker.autos = autosAsset.getText();
                  tracker.furnitures = furnituresAsset.getText();
                  tracker.cds = cdsAsset.getText();
             if(tracker.electronics.length() > 0){
                       //statement that might throw an exception
                       try{
                           electronicsNo = Integer.valueOf(tracker.electronics);
                           tracker.itotal += electronicsNo.intValue();
                         //find invalid number     
                         catch(java.lang.NumberFormatException e){
                           electronicsAsset.setText("Invalid Value");
                       else {
                             tracker.itotal += 0;
             if(tracker.autos.length() > 0){
                        //find invalid again
                         try{
                      autosNo = Integer.valueOf(tracker.autos);
                      tracker.itotal += autosNo.intValue();
               catch(java.lang.NumberFormatException e){
                      System.out.println("Invalid Value");
             else {
          tracker.itotal += 0;
        if(tracker.furnitures.length() > 0){
           //seek invalid numbers
         //statement that might throw an exception.
          try{
            furnituresNo = Integer.valueOf(tracker. furnitures);
            tracker.itotal +=  furnituresNo.intValue();
        // statements to be executed if a matching Java exception occurs in try.
          catch(java.lang.NumberFormatException e){
             furnituresAsset.setText("Invalid Value");
             else {
          tracker.itotal += 0;
        if(tracker.cds.length() > 0){
         //check then find invalid
          try{
            cdsNo = Integer.valueOf(tracker.cds);
            tracker.itotal += cdsNo.intValue();
          catch(java.lang.NumberFormatException e){
            cdsAsset.setText("Invalid Value");
          else {
          tracker.itotal += 0;
        // display
         serialNum = new Integer(tracker.itotal);
         output = serialNum.toString();
         this.items.setText(output);
         tracker.icost = (tracker.itotal * 300.00);
         cost = new Double(tracker.icost);
         output2 = cost.toString();
         this.cost.setText(output2);
       // electronics, autos, furnitures, cds
       // if user delete all items from assets
       if(source == delete){
         serialNumber.setText("");
         electronicsAsset.setText("");
         autosAsset.setText("");
         furnituresAsset.setText("");
         cdsAsset.setText("");
         serialNumber.setText("");
         tracker.icost = 0;
         cost = new Double(tracker.icost);
         output2 = cost.toString();
         this.cost.setText(output2);
         tracker.itotal = 0;
         serialNum = new Integer(tracker.itotal);
         output = serialNum.toString();
         this.items.setText(output);
      // main method
      public static void main( String[] args )
            TestProgram frame = new TestProgram();
              // title of JFrame
              frame.setTitle("Asset tracking program");
            // mew window created
            WindowListener l = new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                            System.exit(0);// exit
            // add window from package then show window
            frame.addWindowListener(l);
            frame.pack();
            frame.setVisible(true);

    I don't understand the question. Are you telling us you don't understand how to use System.out.println(...);? How do you debug programs without using this method?
    Usually the first program someone learns to write is something like:
    public static void main(String[] args)
        System.out.println("Hello World");
    after they press "current status" or if they "delete" their current itemsYou want to do some activity when the above actions occur. You must already have code in your program to do something in the above cases. So simply add the System.out.println(..) statements in the same part of code.

  • Output plsql variable to command window

    I am executing a PLSQL stored procedure from my java class. I want to know how to output a variable within the PLSQL to the command window?
    thanks

    I don't understand the question. Are you telling us you don't understand how to use System.out.println(...);? How do you debug programs without using this method?
    Usually the first program someone learns to write is something like:
    public static void main(String[] args)
        System.out.println("Hello World");
    after they press "current status" or if they "delete" their current itemsYou want to do some activity when the above actions occur. You must already have code in your program to do something in the above cases. So simply add the System.out.println(..) statements in the same part of code.

  • From command window to jframe

    Hi,
    i wrote a bunch of code that writes stuff into the command window (using that system.println thing) But now i've made a gui (just a jframe with a little text area, a menu and some buttons) how do i get everything thats written in the command window to get written into the gui inside that little text area without me changing lots of code?
    So in other words is there a way i get the command window to be inside my gui? Is this possible?
    Thanx :)

    you might be able to get the command window in your gui using a lot of native coding and C++ but I agree with Noah it would probably be a lot easier to just use TextArea.append() instead of System.out.println() then all your ouput will just get written in the text area on your gui.

  • To exit the command window after  weblogic app server startup

    Hi,
    The startWeblogic.cmd starts the weblogic V 10.0 server without exiting the prompt. Since our requirement wanted the startWeblogic script to exit the window after server startup, we set the parameter SET doExitFlag=true in startweblogic.cmd file , but the result was same as earlier the server started without exiting the window. Also we tried Redirecting the server starup output to a file , but even this did not exit the window.
    My query is
    1. What parameter options one should use to start the server so that it exits the command window in which it was started?
    2. Is there an alternate way to do the same,something like to start it as a background process in Windows?
    Any help in this regard would be great.
    Thanks in Advance.
    Best Regards,
    Preethi

    Not sure about parameters to startWeblogic.cmd, but from Windows you could
    try
    start /b startWebLogic.cmd > start.log 2 >& 1
    <Preethi Ghalke> wrote in message news:[email protected]..
    Hi,
    The startWeblogic.cmd starts the weblogic V 10.0 server without exiting the
    prompt. Since our requirement wanted the startWeblogic script to exit the
    window after server startup, we set the parameter SET doExitFlag=true in
    startweblogic.cmd file , but the result was same as earlier the server
    started without exiting the window. Also we tried Redirecting the server
    starup output to a file , but even this did not exit the window.
    My query is
    1. What parameter options one should use to start the server so that it
    exits the command window in which it was started?
    2. Is there an alternate way to do the same,something like to start it as a
    background process in Windows?
    Any help in this regard would be great.
    Thanks in Advance.
    Best Regards,
    Preethi

  • Sqlagent90.exe keeps running in a command window

    HELP!, This is annoying and beyond belief.  I installed SqlServer Developer edition without any problem than I installed SqlServer Express and now whenever I boot my PC, I have a command window that appear with nothing in it and the following title:
    "C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Binn\SQLAGENT90.EXE"
    Now if I go to the Task Manager and kill the SQLAGENT90.EXE process, it goes away for a second than comeback with the nice command windows.
    Any idea what's wrong and how I can get rid of it?
    Bye the way, everything else seems to be working fine with the application.
    Thanks,
    Claude.

    Claude,
    Some how the service was marked as allowed to interact with the desktop. This is not the default configuration and there is no need for it, so I'm not sure how you ended up in this state. To clean this us launch the service control manager (Control Panel -> Administrative Tools -> Services), scroll down to the Agent service (SQL Server Agent (instance name)) and double click it to bring up the Properties page. On the Properties page select the Log On tab. The service is probably running as Local System, below this is a check box labeled "Allow service to interact with desktop", uncheck that box, press the Apply button, go to the General tab and stop and start the service. You should no longer see the cmd window pop up. Click OK to dismiss the Properties page.
    Cheers,
    Dan

  • Windows Command Window

    I have created a Java application with a GUI interface. Is there any way to invoke the application without having wht Windows command window coming up allow with the GUI interface

    Try using the command javaw to run your program instead of the java command. Maybe also with the windows start command. Something like that, check the help for javaw (the command comes with the windows JRE's). Should be what you need, haven't done it for my own programs but used it for some other java stuff so just try it and so on. I believe it will do what u want.

  • Command Window Database Access via a DataSource (Pt 2)

    Hi.
    For those of you (especially duffymo) who were good enough to make suggestions concerning my problems when attempting to access an Oracle 10g database via a DataSource from a servlet the week before last, I'm pleased to say that I got that working on my return from holiday!
    Now to return to an earlier problem...
    I'd like to access the same database from a standalone, command window program and have tried setting the INITIAL_CONTEXT_FACTORY and PROVIDER_URL properties as shown below.
    Hashtable envt = new Hashtable();
    envt.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.apache.commons.dbcp.BasicDataSourceFactory");
    envt.put(Context.PROVIDER_URL, "http://localhost:8080");
    Context initialContext = new InitialContext(envt);
    Context context =(Context)initialContext.lookup("java:comp/env");
    DataSource dataSource =(DataSource)context.lookup("jdbc/Oracle_Finances");
    connection = dataSource.getConnection();
    However, this generates error messages with root exception "java.lang.ClassNotFoundException: org.apache.comons.dbcp.BasicDataSourceFactory".
    If I copy the JAR file containing BasicDataSourceFactory (viz. commons-dbcp-1.2.1.jar) from Tomcat's common\lib folder into Java's jre\lib\ext folder, then I get a similar set of error messages, but the root exception changes from ClassNotFoundException to "java.lang.ClassCastException: org.apache.comons.dbcp.BasicDataSourceFactory".
    Does anybody know where the problem lies??
    Any help most appreciated.
    Cheers.
    Jan

    I'd like to access the same database from a
    standalone, command window program and have tried
    setting the INITIAL_CONTEXT_FACTORY and PROVIDER_URL
    properties as shown below.I've never done this. I'm not sure if it can or should be done.
    The problem is that the standalone app isn't part of any Tomcat context.
    It also ties your standalong app to Tomcat. I don't think you want to do that.
    There's got to be a way to manage this without resorting to Tomcat. I'd look at the Commons docs to see.
    If I copy the JAR file containing
    BasicDataSourceFactory (viz. commons-dbcp-1.2.1.jar)
    from Tomcat's common\lib folder into Java's
    jre\lib\ext folder, This is a terrible idea. You shouldn't be putting anything in jre/lib/ext - it'll cause more problems than it's worth.
    Create a /lib directory for your project and put the 3rd party JARs in there. Disk space is cheap, and keeping all the artifacts that you need to create your app in one place is a good idea.
    %

  • Hide visible command window when running cscript.exe

    I'm using vbs wrappers when I'm installing applications with MDT because they offer me better control and logging capability. Currently when task sequencer executes application install with cscript.exe there is this visible command window. Is it possible
    to completely hide it without big modifications to MDT?

    If you are using ZTIUtility.vbs then I recommend:
    oUtility.RunWithConsoleLoggingAndHidden "cmd.exe /c echo Hello World!"
    Keith Garner - Principal Consultant [owner] -
    http://DeploymentLive.com

  • NOT displaying the command window when running applications

    hi
    i'v been seraching all over the web for a way to get rid of the command window (dos shell) that appears when running a java swing based application (or any other). i currently have a batch file that loads all the required libraries into the class path and then calls the application's main class. problem is, the DOS command window stays open. is there any way to have it not display (obviously without losing my program in the process). at the very least can it be minimised automatically (just the dos window)?? though i think getting rid of it all together would be best.
    i would really love some help on this... very over seeing that dos window displayed...
    any help would be greatly appreciated.... thanks heaps
    Takis

    On Win NT
    REM get rid of commnand window
    start /B java swingapp
    REM minimize the command window
    start /MIN java swingapp
    REM for other options
    help start
    Hope this helps,
    Sathish.
    hi
    i'v been seraching all over the web for a way to get rid of the command window (dos shell) that appears when running a java swing based application (or any other). i currently have a batch file that loads all the required libraries into the class path and then calls the application's main class. problem is, the DOS command window stays open. is there any way to have it not display (obviously without losing my program in the process). at the very least can it be minimised automatically (just the dos window)?? though i think getting rid of it all together would be best.
    i would really love some help on this... very over seeing that dos window displayed...
    any help would be greatly appreciated.... thanks heaps
    Takis

Maybe you are looking for