How do I execute a command without listing it?

∥☆過路亽.° 提交于 2019-12-13 03:23:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!