问题
I am currently making a text-based game written in Java that runs completely in the command prompt. I created a batch file to run the game:
cd D:\This PC\(Location of game files)
java (Game title)
When the code runs in the command prompt, however, it is preceded by the two commands executed in the batch file. Is there any way to execute these commands without the terminal listing them above?
回答1:
Yes. Turn echo off by making the first line
@echo off
cd D:\This PC\(Location of game files)
java (Game title)
or add @
before each command (as I did above) to not echo.
@cd D:\This PC\(Location of game files)
@java (Game title)
来源:https://stackoverflow.com/questions/53939030/how-do-i-execute-a-command-without-listing-it