尝试使用某些批处理。
@ echo off
IF EXIST %CD%\Minecraft.exe
Minecraft.exe
IF NOT exist %CD%\Minecraft.exe
wget.exe https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe
Minecraft.exe
pause
我做错了什么?当我运行它时,CMD就会关闭。
答案 0 :(得分:8)
我做错了什么?
您可以阅读IF命令if /?
的帮助。
它解释了if期望所有在一行
@echo off
IF EXIST %CD%\Minecraft.exe Minecraft.exe
IF NOT exist %CD%\Minecraft.exe wget.exe https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe Minecraft.exe
pause
或使用ELSE
@echo off
IF EXIST %CD%\Minecraft.exe (
Minecraft.exe
) ELSE (
wget.exe https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe Minecraft.exe
)
pause