Problem in Executing Command Line

Hello all,
   I am trying to execute the Perforce command lines through LabVIEW System Exec. These commands are working propery when directly entered in the command prompt, but through LabVIEW it is not working properly.
"P4 client -i  <E:\template.txt"
This command will read the file and create a client. Whenever we are doing this kind of  file operation (reading or writing), the command through LabVIEW is not working and the System Exec VI is giving the Standartd error output as  " Usage: client -i [ -f ] Unexpected arguments", but working perfectly in the comand prompt,

hi cranen,
  use "cmd/c P4 client -i  <E:\template.txt" as command line input to the system exec.vi.
Thanks and regards,
srikrishnaNF

Similar Messages

  • Execute command lines from Xcelsius 2008

    Hello,
    Is there any possible way to execute command lines from Xcelsius 2008 swf?
    Thank you.

    Hi,
    You cannot call out to command-line from a Flash SWF, it is sandboxed so does not know how to do any of that.
    One (complicated) option would be to write your own app to embed the SWF into, a real app can then call out to do whatever you want, then you just have to get the SWF to communicate with your app using External Interface, it would be a lot of work.
    Regards
    Matt

  • XP to windows7: Executing command line: "bcdedit.exe". CreateProcess failed. Code(0x80070002)

    I m working to migrate from XP SP3 to Windows 7 using SCCM 2012 R2 CU4 but I have a boot error similar as above. Normally with CU4, XP will be supported by WInPE 5.1 (ADK 8.1). it's a refresh scenario, the task sequence was launched from XP. USMT will
    use a local store.
    The smsts log has a content as follow:
    [Successfully completed the action (Restart Computer in WinPE) with the exit win32 code 0]LOG]!><time="10:18:00.843+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740"
    file="instruction.cxx:830">
    <![LOG[Set authenticator in transport]LOG]!><time="10:18:00.859+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="libsmsmessaging.cpp:7734">
    <![LOG[Set a global environment variable _SMSTSLastActionRetCode=0]LOG]!><time="10:18:01.156+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:668">
    <![LOG[Set a global environment variable _SMSTSLastActionSucceeded=true]LOG]!><time="10:18:01.156+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:668">
    <![LOG[Clear local default environment]LOG]!><time="10:18:01.156+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:807">
    <![LOG[Updated security on object C:\_SMSTaskSequence.]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="utils.cpp:1704">
    <![LOG[Set a global environment variable _SMSTSNextInstructionPointer=2]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:668">
    <![LOG[Set a TS execution environment variable _SMSTSNextInstructionPointer=2]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:386">
    <![LOG[Set a global environment variable _SMSTSInstructionStackString=0]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:668">
    <![LOG[Set a TS execution environment variable _SMSTSInstructionStackString=0]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:414">
    <![LOG[Save the current environment block]LOG]!><time="10:18:01.218+240" date="02-26-2015" component="TSManager" context="" type="0" thread="1740" file="executionenv.cxx:833">
    <![LOG[Executing command line: "bcdedit.exe"]LOG]!><time="10:18:01.234+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="commandline.cpp:827">
    <![LOG[CreateProcess failed. Code(0x80070002)]LOG]!><time="10:18:01.234+240" date="02-26-2015" component="TSManager" context="" type="3"
    thread="1740" file="commandline.cpp:1018">
    <![LOG[Command line execution failed (80070002)]LOG]!><time="10:18:01.234+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="commandline.cpp:1245">
    <![LOG[Staging boot image P0100002]LOG]!><time="10:18:01.250+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootimage.cpp:717">
    <![LOG[ResolveSource flags: 0x00000000]LOG]!><time="10:18:01.500+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="resolvesource.cpp:3201">
    <![LOG[SMSTSPersistContent: . The content for package PO100002 will be persisted]LOG]!><time="10:18:01.500+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740"
    file="resolvesource.cpp:3212">
    <![LOG[Locations: Multicast = 0, HTTP = 1, SMB = 0.]LOG]!><time="10:18:01.500+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="resolvesource.cpp:2749">
    <![LOG[Multicast is not enabled for the package.]LOG]!><time="10:18:01.500+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="resolvesource.cpp:2789">
    <![LOG[Trying
    http://sccmsrv.contoso.com:80/SMS_DP_SMSPKG$/P0100002/sccm?/boot.PO100002.wim to C:\_SMSTaskSequence\Packages\PO100002\boot.PO100002.wim ]LOG]!><time="10:18:18.265+240" date="02-26-2015" component="TSManager" context=""
    type="1" thread="1740" file="downloadcontent.cpp:1592">
    <![LOG[VerifyContentHash: Hash algorithm is 32780]LOG]!><time="10:18:18.265+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="downloadcontent.cpp:1870">
    <![LOG[Found boot image C:\_SMSTaskSequence\Packages\PO100002\boot.PO100002.wim]LOG]!><time="10:18:22.156+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740"
    file="bootimage.cpp:1115">
    <![LOG[Copying boot image locally...]LOG]!><time="10:18:22.156+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootimage.cpp:745">
    <![LOG[ADK installation root registry value not found.]LOG]!><time="10:18:30.125+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="wimfile.cpp:207">
    <![LOG[Loaded C:\Program Files\Windows Imaging\wimgapi.dll]LOG]!><time="10:18:30.171+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="wimfile.cpp:344">
    <![LOG[Opening image file C:\_SMSTaskSequence\WinPE\sources\boot.wim]LOG]!><time="10:18:30.171+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="wimfile.cpp:422">
    <![LOG[Applying image 1 to volume C:\_SMSTaskSequence\WinPE]LOG]!><time="10:18:30.296+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="wimfile.cpp:613">
    <![LOG[Closing image file C:\_SMSTaskSequence\WinPE\sources\boot.wim]LOG]!><time="10:18:32.906+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="wimfile.cpp:458">
    <![LOG[Capturing WinPE bootstrap settings]LOG]!><time="10:18:32.921+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="winpesettings.cpp:80">
    <![LOG[Environment scope successfully created: Global\{E7E5BB69-6198-4555-B5CA-6C46A2B5EB78}]LOG]!><time="10:18:32.921+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740"
    file="environmentscope.cpp:623">
    <![LOG[Executing command line: "osdnetsettings.exe" capture adapters:true scope:Global\{E7E5BB69-6198-4555-B5CA-6C46A2B5EB78}]LOG]!><time="10:18:32.921+240" date="02-26-2015" component="TSManager" context=""
    type="1" thread="1740" file="commandline.cpp:827">
    <![LOG[==============================[ OSDNetSettings.exe ]===========================]LOG]!><time="10:18:33.343+240" date="02-26-2015" component="OSDNetSettings" context="" type="1" thread="3644"
    file="main.cpp:134">
    <![LOG[Command line: "osdnetsettings.exe" capture adapters:true scope:Global\{E7E5BB69-6198-4555-B5CA-6C46A2B5EB78}]LOG]!><time="10:18:33.343+240" date="02-26-2015" component="OSDNetSettings" context=""
    type="1" thread="3644" file="main.cpp:135">
    <![LOG[No adapters found with non-empty DNSDomainSuffixSearchOrder]LOG]!><time="10:18:33.484+240" date="02-26-2015" component="OSDNetSettings" context="" type="0" thread="3644" file="netwmiadapterconfig.cpp:408">
    <![LOG[Captured settings for adapter 1]LOG]!><time="10:18:34.875+240" date="02-26-2015" component="OSDNetSettings" context="" type="1" thread="3644" file="netsettings.cpp:99">
    <![LOG[OSDNetSettings finished: 0x00000000]LOG]!><time="10:18:34.875+240" date="02-26-2015" component="OSDNetSettings" context="" type="1" thread="3644" file="main.cpp:192">
    <![LOG[Process completed with exit code 0]LOG]!><time="10:18:34.875+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="commandline.cpp:1123">
    <![LOG[Installing boot image to hard drive]LOG]!><time="10:18:34.906+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootimage.cpp:622">
    <![LOG[Backing up existing boot system before trying to set up new boot system]LOG]!><time="10:18:34.906+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740"
    file="bootimage.cpp:645">
    <![LOG[BootLoader::backup: C:\, C:\_SMSTaskSequence\backup]LOG]!><time="10:18:35.109+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootloader.cpp:85">
    <![LOG[BootLoader::restore: C:\_SMSTaskSequence\WinPE, C:\]LOG]!><time="10:18:41.187+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootloader.cpp:382">
    <![LOG[Saving bcd store to C:\_SMSTaskSequence\WinPE\boot\BCD]LOG]!><time="10:18:41.734+240" date="02-26-2015" component="TSManager" context="" type="1" thread="1740" file="bootconfigimplbcd.cpp:703">
    <![LOG[Executing command line: "C:\_SMSTaskSequence\WinPE\windows\system32\bootsect.exe" /NT60 SYS /MBR]LOG]!><time="10:18:42.500+240" date="02-26-2015" component="TSManager" context="" type="1"
    thread="1740" file="commandline.cpp:827">
    <![LOG[CreateProcess failed. Code(0x800700C1)]LOG]!><time="10:18:42.500+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="commandline.cpp:1018">
    <![LOG[Command line execution failed (800700C1)]LOG]!><time="10:18:42.500+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="commandline.cpp:1245">
    <![LOG[Failed to install boot image.
    Unknown error (Error: 800700C1; Source: Unknown)]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="bootimage.cpp:682">
    <![LOG[Failed to install boot image PO100002.
    Unknown error (Error: 800700C1; Source: Unknown)]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="engine.cxx:840">
    <![LOG[Failed to reboot the system. Error 0x(800700c1)]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="engine.cxx:953">
    <![LOG[Failed to initialize a system reboot.
    Unknown error (Error: 800700C1; Source: Unknown)]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="engine.cxx:577">
    <![LOG[Fatal error is returned in check for reboot request of the action (Restart Computer in WinPE).
    Unknown error (Error: 800700C1; Source: Unknown)]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="engine.cxx:273">
    <![LOG[An error (0x800700c1) is encountered in execution of the task sequence]LOG]!><time="10:18:42.515+240" date="02-26-2015" component="TSManager" context="" type="3" thread="1740" file="engine.cxx:348">
    Thank
    Lourh

    I'm not entirely sure if this was fixed in the newer CUs, but have you seen this thread?
    https://social.technet.microsoft.com/Forums/en-US/041975df-a8a8-48cb-8d9f-0446c35210fe/sccm-2012-r2-boot-image-wont-load-in-windows-xp?forum=configmanagerosd
    It offers a couple of alternatives too (i.e., http://davejaskie.com/2014/04/03/installing-a-legacy-boot-image-in-sccm-to-support-xp-migrations/)
    Fausto

  • Problem executing command line program

    Hi I have a tuxedo command line app in Solaris 2.6. I was able to execute the program from unix prompt however when I try to do it from JAVA program, it does not work.
    I have to execute from command line as follows
    $ud32<SPACE>-U<SPACE>login<nl>
    SRVCNM<TAB>CB_EXESUB<nl>
    CLFY_SUB<TAB>ExeternalMsg<nl>
    EQUIP_ID<TAB>1<nl>
    <nl>
    during command line execution from second line on you will not get the prompt. After entering a balnk line the program will execute and provide the output.
    I was aslo able to execute the program by putting the last 4 lines in a file(say test.bat) and executing by issuing following command at the unix prompt
    $ud32 -U sa<test.bat
    My java program as follows.
    import java.io.*;
    public class udexec {
    public static void main(String args[]) {
    try{
    Runtime rt = Runtime.getRuntime();
    System.out.println("Before");
    Process prcs = rt.exec("ud32 -U sa");
    System.out.println("After: " + prcs);
    InputStreamReader isr = new InputStreamReader(prcs.getInputStream());
    PrintWriter out = new PrintWriter(prcs.getOutputStream());
    out.println("SRVCNM CB_EXESUB");
    out.println("CLFY_SUB ExternalMsg");
    out.println("EQUIPID 1");
    out.println("");
    int ret = isr.read();
    String line;
    System.out.println("Before Print");
    System.out.println(ret);
    catch (Exception e) { System.out.println(e); }
    Any help will be greatly appreciated.
    Thank You
    Raju

    Hmm, maybe you should also give additional Excape Characters to the Process (so adding \t where you have written <TAB>, or adding \r to the lines).

  • Problem associated with Command Line arguments

    hi ,
    I am not able to pass a file path as command line argument in java.
    Actually i want to run a java program from the command prompt passing a file path . Something like this i tried to do , but its not working.
    D:\VISHAL\src> java CopyFile C:\Documents and Settings\Administrator\Desktop\link.txt
    where ,
    CopyFile is the name of my class which i am going to run
    C:\Documents and Settings\Administrator\Desktop\link.txt is the argument.
    Can anyone tell me whether a java program accepts an argument like this, if yes please tell me the exact syntax..
    Thanks
    Vishal J
    Message was edited by:
    vishal_vj

    is there any other way of solving this?Y don't U try it out with the logic as mentioned
    below it wud be the case if U r not going with
    java CopyFile "C:\Documents and
    Settings\Administrator\Desktop\link.txt" 1
    String filepath = new String();
    for(int i = 0; i < Arg.length; i++)
    filepath.append(Arg);
    File f = new File(filepath);
    What????  This is a non-solution to a non-problem.  First of all, you would be constructing a filename without spaces, when the real path contains spaces.  Secondly, even if you did insert spaces it would not matter.  What if the String (and it does not have to be a filename) contained tabs rather than spaces.  The real (and really only) solution to the problem is to put quotes around the argument, for the exact reason stated in my last post.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • To execute command line from java programmin

    Hi,
    I need to execute a command line like ping command from java applications can any help me on this. Thanks in advance.

    Runtime.exec
    Also read: When Runtime.exec() won't: Navigate yourself around pitfalls related to the Runtime.exec() method

  • Execute command line from Java

    I have an easy one for you!
    I would like to know how I can execute a command line from my java code.
    The only thing I want to do is to launch a html page with the default browser in my computer when I press one button of my java application but I dont know wich class I should use to do it. My application will already know what is the file name.
    Thank for your help
    Eric

    Javaworld has some source code that does this:
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

  • How to make system call to execute command line in JAVA?

    Hi,
    I am new in JAVA. How to make system call to execute the following command line in JAVA in LINUX environment.
    rpm -qa jdkIn C programming, use as such:
    system ("rpm -qa jdk");
    How about JAVA?
    Thanks.

    Runtime.getRuntime().exec. But first read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to execute command line by Java

    Hi all,
    I have the following DOS command line that I need to execute it through Java:
    C:\Documents and Settings\Mxmler\Desktop\bin>vr1tovr2 Box.wrl -o Box2.wrl
    I know that I have to use Runtime.getRuntime().exec, But can anyone show me how to use it for the above?
    Thanks

    Mxmler wrote:
    I need your help please
    Forget about the first thread
    vr1tovr2 located inside a sub directory called converted (not in the main directory of the project constructed by eclipse)You have to tell the system where to find the program you're trying to run. You can specify the full path to the executable. Alternatively, you can specify the PATH environment variable when you call exec() (and I presume there's something similar for java.lang.ProcessBuilder). Read the docs.
    Box.wrl & Box2.wrl (will be generated) both of them are located in another directory called usrYou can either specify full paths to those files, or you can set the current working directory when you call exec(). So you'd tell exec() that you're in the directory where those files are. Read the docs.
    I have tried to do the following and I got the following error message: CreateProcess error=2, The system cannot find the file specifiedYou need to do what I said above, in particular, the first one (where you tell the system where to find the program you're trying to run).
    String path = System.getProperty("user.dir");
    String userFolder = "usr";
    String fileName = "mxmler";
    String extension = ".wrl";
    Runtime.getRuntime().exec("vr1tovr2 "
                + Key.QUOTE
                + path
                + Key.FORWARD_SLASH
                + userFolder
                + Key.FORWARD_SLASH
                + fileName + extension
                + Key.QUOTE
                + " -o "
                + Key.QUOTE
                + path
                + Key.FORWARD_SLASH
                + userFolder
                + Key.FORWARD_SLASH
                + fileName + "v2" + extension
                + Key.QUOTE);If you're going to break it down like that, then don't use the version of exec() that takes a single String for the whole command line. Use the version of exec() that takes an array of Strings (the first String in the array is the program to run, and the remaining strings in the array are arguments to that program).

  • Executing command line utility

    Hi all,
    I'm trying to use the Runtime and Process classes to launch a win32 command line utility from within my java app.
    I can successfully launch the app with no arguments and have it print the help description to a JTextArea. This is the behavior of the utility if you simply call it with no arguments.
    But when I call the utility with some arguments, the java app seemingly locks up and I get no input from either getInputStream() or getErrorStream()
    I also tried passing the arguments to the utility in a String[] with no luck. Also tried having the Runtime.exec() function call a .bat file with no luck, even though launching the bat file directly works fine.
    Does anyone know how to work with a command line utility from within java? Is it possible to have it at least pop up a console window so I can see what is going on?
    Any help would greatly be appreciated..
    I've read the API's and relavent topics on the forums only to find myself even more confused on whether this is possible.
    Regards,
    Jim

    Well, I've been trying all sorts of combinations of the code, so it changes often.
    here is what I have now..
    <CODE>
         private void fetchDB()
              try
                   Runtime rt = Runtime.getRuntime();
                   Process p = rt.exec("pilot-xfer.exe");
                   BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                   String s = "";
                   while((s = in.readLine()) != null)
                        resultsTextArea.append(s);
                   in.close();
                   BufferedReader errIn = new BufferedReader(new InputStreamReader(p.getErrorStream()));
                   String e = "";
                   while((e = errIn.readLine()) != null)
                        resultsTextArea.append(e);
                   errIn.close();
              catch(IOException i)
                   resultsTextArea.append("IO Exception");
    </CODE>
    I tried the way you outlined above but it seems to ignore the arguments and prints out the help text as if no arguments were given.
    The full command I'm trying to pass is:
    "pilot-xfer.exe -f CH-ResultsDB"
    This command should prompt a single line telling the user to hit the HotSync button on their palm and once they do it will fetch the specified database.
    I also tried calling a .bat file that would then do the command with identical results. If the bat simply said "pilot-xfer.exe" with no arguments it would work. if I add arguments the java app seems to lock up.
    Note, running the .bat file by itself works fine with or without arguments.
    Thanks for any help you can provide, this problem has been badgering me for nearly a week now..
    Regards,
    Jim

  • Problem using sql command line

    Hello!
    I do have some problems with using the command line for INSERT statements. When I perform insert statements the data of these statements are lost as soon as I close the command line. Other statements like SELECT or CREATE TABLE work properly.
    any idea?
    regards
    D.

    I do have some problems with using the command line
    for INSERT statements. When I perform insert
    statements the data of these statements are lost as
    soon as I close the command line. Other statements
    like SELECT or CREATE TABLE work properly.
    Have you run "COMMIT", after insert statement ??
    You need to run "commit" (preferable) or exit (Oracle explicit commit on exit).
    You might have close the sqlplus window without running above command.
    See following thread for explanation with example
    Re: commit problem!!
    Virag

  • Problem generating via command line

    I have a RoboHelp project, and I can generate WebHelp via
    RoboHelp with no problem. But when I try to generate it using the
    command line, not all of the files get copied into my output folder
    (style sheets and images are missing, maybe more things too). I see
    a lot of "Template Error: could not resolve macro...". I do have
    full administrator rights on my machine (I know that can cause
    problems for people). Any recommendations? Thanks for the
    help!

    I have a RoboHelp project, and I can generate WebHelp via
    RoboHelp with no problem. But when I try to generate it using the
    command line, not all of the files get copied into my output folder
    (style sheets and images are missing, maybe more things too). I see
    a lot of "Template Error: could not resolve macro...". I do have
    full administrator rights on my machine (I know that can cause
    problems for people). Any recommendations? Thanks for the
    help!

  • Executeing Command Line Java

    Greetings, I need to execute the following command line in
    java (and get the results via CF):
    java -cp
    /Volumes/htdocs/encrypt/me/;../bcprov-jdk14-133.jar;.;
    com.me.crypt.Do test
    I have tried to do this with cfexecute but I cant seem to use
    the arguments attribute correctly. I have even tried this but all I
    ever get back is a blank string:
    <cfexecute name="java" arguments="-version" timeout="100"
    variable="MyObj" />
    Im also not sure how to create a object with
    the"../bcprov-jdk14-133.jar" in there. Normally I would just put
    the classes in the classpath and create a object but the jar is
    throwing things off. Its not my java class and Im not really at
    liberty to change it.

    When you provide the name of the class, it has to include its full package name (your's doesn't have a package) and the parent directory of the root of the package has to be on the claspath. In your case: java -cp Java Simple It works in the first case because if there's no classpath specified and no env var set, then the classpath is assumed to be the current directory.

  • Problem in executing command prompt commands through application

    Hi,
    I am facing issue in executing commands through VC++ application.
    My application is a dialog based MFC application in VS2008.
    I want to execute below commands programmatically.
    devenv D:\TestApp\TestApp.sln /rebuild release
    devenv D:\TestApp\TestApp.sln /rebuild debug
    But I am not able to set the current directory path as "D:\TestApp\" programatically.
    Through which API I can execute multiple commands on command prompt programmatically same as  we do manually on cmd.
    Please Help.
    Thanks in Advance. 
    Thanks & Regards, Mayank Agarwal

    I want to execute below commands programmatically.
    devenv D:\TestApp\TestApp.sln /rebuild release
    devenv D:\TestApp\TestApp.sln /rebuild debug
    But I am not able to set the current directory path as "D:\TestApp\" programatically.
    Through which API I can execute multiple commands on command prompt programmatically same as  we do manually on cmd.
    Why can you "not able to set the current directory path as "D:\TestApp\" programatically"? Are you forgetting to escape the backslashes?
    Why to you need to set the current directory anyway?
    What is the problem with executing multiple commands?
    As to your basic goal, have you looked at
    system()
    ShellExecute()
    ShelExecuteEx()
    CreateProcess()
    ? Perhaps you should show us what you have tried.
    David Wilkinson | Visual C++ MVP

  • Problem during executing Command Prompt

    Hi All
    My current code is executing system commands through java programme,like �dir�,�date� itc.Whenever I run the code the desired output comes.But when I am running the code continuselly then lots of command prompt open regularlly.
    Is there any way to stop the code from execution untill unless the command prompt get closed manually?Here is my code.
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    interface IPerlService
         public String BZMCreateZone(String s);
         public int BZMRenew();
    public class Sample
         public void BZMCreateZone()
              Runtime runtime;
              Process process;
              String s=null;
              String str=null;
              try
                   runtime = Runtime.getRuntime();
                   process =runtime.exec("cmd /c start dir");
                   str=process.toString();
              try
                   process.waitFor();
                   catch (InterruptedException e)
                   e.printStackTrace();
                   BufferedReader reader = new BufferedReader(
                   new InputStreamReader(process.getInputStream()));
              s = reader.readLine();
              catch (IOException ex)
                   ex.printStackTrace();
         public static void main(String[] args)
              Sample obj_Sample= new Sample();
              obj_Sample.BZMCreateZone();
    }

    I want to execute below commands programmatically.
    devenv D:\TestApp\TestApp.sln /rebuild release
    devenv D:\TestApp\TestApp.sln /rebuild debug
    But I am not able to set the current directory path as "D:\TestApp\" programatically.
    Through which API I can execute multiple commands on command prompt programmatically same as  we do manually on cmd.
    Why can you "not able to set the current directory path as "D:\TestApp\" programatically"? Are you forgetting to escape the backslashes?
    Why to you need to set the current directory anyway?
    What is the problem with executing multiple commands?
    As to your basic goal, have you looked at
    system()
    ShellExecute()
    ShelExecuteEx()
    CreateProcess()
    ? Perhaps you should show us what you have tried.
    David Wilkinson | Visual C++ MVP

Maybe you are looking for