如何在不列出命令的情况下执行命令? [英] How do I execute a command without listing it?

查看:86
本文介绍了如何在不列出命令的情况下执行命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在制作一个用Java编写的基于文本的游戏,该游戏可以完全在命令提示符下运行.我创建了一个批处理文件来运行游戏:

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?

推荐答案

是.通过制作第一行来关闭回声

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)

这篇关于如何在不列出命令的情况下执行命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆