Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to make a batch file that:

  1. Opens cmd.exe
  2. Within that Command Prompt runs cd C:\mywork\ then runs set path=%path%;C:\Program Files\Java\jdk1.7.0_05\bin and at the final runs java MCExploit wich runs a .class file, but the final command shows some text like omg|omg so I need to be able to read that text.
  3. Leaves the window open so that I can run additional commands if I wish to

How can I do this?

share|improve this question
1  
What have you tried so far? Why not open cmd.exe and run a batch file containing those commands? – Karan Feb 1 '13 at 19:55
    
I've tried several stuff, but none of them seems to work. I tried for example: START cmd.exe /k "cd C:\mywork\" & "set path=%path%;C:\Program Files\Java\jdk1.7.0_05\bin" & "java MCExploit" but it doesn't show the text I was talking about. When I do it manualy it works but when I do that from the batch I mentioned above, it doesn't show the text. – Juan Lee Feb 1 '13 at 20:02
up vote 0 down vote accepted
  1. Create a batch file with all your commands, for example:

    set path=%path%;C:\Program Files\Java\jdk1.7.0_05\bin
    cd C:\mywork\
    java MCExploit
    
  2. Create a shortcut to Windows\System32\cmd.exe and in the shortcut's Properties, ensure the Target field looks similar to the following:

    C:\Windows\System32\cmd.exe /k C:\MyCmds.bat
    
  3. Done! Double-clicking the shortcut will open a Command Prompt window, execute your batch file and then return back to the prompt and await further orders from you.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .