Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 执行命令行.exe文件_Windows_Batch File_Cmd_Exe - Fatal编程技术网

Windows 执行命令行.exe文件

Windows 执行命令行.exe文件,windows,batch-file,cmd,exe,Windows,Batch File,Cmd,Exe,我有一个从.jar转换过来的.exe文件。 它是一个基于命令的应用程序,所以我必须用批处理脚本启动它。以下是批处理脚本: @echo off cd C:\desktop\plant-text-adventure-win start planttextadventure pause 当我双击批处理脚本时,会发生以下情况:Windows找不到“planttextadventure”。请确认输入的名称是否正确,然后重试。 我不知道发生了什么,在我使用Mac时,我不知道cmd,但我可以确认我在一个名为

我有一个从.jar转换过来的.exe文件。 它是一个基于命令的应用程序,所以我必须用批处理脚本启动它。以下是批处理脚本:

@echo off
cd C:\desktop\plant-text-adventure-win
start planttextadventure
pause
当我双击批处理脚本时,会发生以下情况:
Windows找不到“planttextadventure”。请确认输入的名称是否正确,然后重试。


我不知道发生了什么,在我使用Mac时,我不知道
cmd
,但我可以确认我在一个名为
planttextadventure.exe
的文件夹中有一个名为
plant text adventure win

的可执行文件,您应该通过在shell中执行它来测试批处理文件

只需在开始菜单中输入命令
cmd
,即可打开外壳。在这个黑框中,您现在只需从批处理脚本中输入命令并查找一些错误消息

如果您查看脚本,我猜
cd
命令(用于更改当前目录)不正确。也许你应该换成

cd %USERPROFILE%\Desktop\plant-text-adventure-win
因为桌面文件夹不是直接安装在根驱动器下,而是在可用的用户配置文件中

另一个解决方案是打开windows资源管理器,转到要执行的.exe文件,用鼠标右键将.exe文件拖放到桌面上


然后出现一个上下文菜单,您可以选择“创建快捷方式”选项。

这很奇怪。当我尝试你告诉我的方法时,我可以切换到
桌面
,但不能切换到
植物文本冒险赢
。更奇怪的是,我的桌面上还有植物文字冒险的胜利。因为我使用的是虚拟机,所以会是这样吗?也许文件夹不在您的桌面上,而只是指向它的快捷方式,文件夹本身位于您的计算机上的其他位置。但这都是胡乱猜测。好吧,不管你是在虚拟机中运行,还是直接在硬件上运行。