开发者

How do I call a permanent command prompt?

开发者 https://www.devze.com 2022-12-10 03:03 出处:网络
In Windows, I made a small script to compile and then run a Java application: javac helloWorld.java java helloWorld

In Windows, I made a small script to compile and then run a Java application:

javac helloWorld.java
java helloWorld

helloWorld prints "Hello, world!" and then the command prompt closes immediately. What I want to happen is for the program to execute then have a new l开发者_StackOverflowine on the command prompt ready to go.

EDIT: 1 more stipulation. It needs to be just one batch file, not a batch file calling another one.


Append the line:

cmd

...at the end of your batch file.


you need to start an instance of cmd.exe and just let it run.


You could start the script like this:

cmd /K script.cmd

This will keep the cmd shell open.

You can accomplish this by creating a desktop shortcut with the given line.

0

精彩评论

暂无评论...
验证码 换一张
取 消