0

Trying to play with some Batch.

@ 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 

What have I done wrong? CMD just closes when I run it.

1
  • what is the value of %CD%. Echo %CD% and let us know. Commented Mar 14, 2012 at 18:52

1 Answer 1

8

What have I done wrong?

You could read the help of the IF command if /?.

It explains that the if expects all on one line

@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 

Or use the ELSE

@echo off IF EXIST %CD%\Minecraft.exe ( Minecraft.exe ) ELSE ( wget.exe https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe Minecraft.exe ) pause 
Sign up to request clarification or add additional context in comments.

2 Comments

That did it. Had to add a line after the download thought. Thank you.
Jack, since Jeb got it right for you, you should help him out and check his answer as correct in the upper right.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.