batch file not reconzied as such

legokill101

Honorable
Apr 10, 2013
2,020
0
12,160
i am trying to launch a minecraft mod pack that uses a .bat file to launch but it was alawys closing right after it opened and its valid the cmd probs its trying to exicuted but windows 7 for some reason is not reconizing the path to launch it as valid
in other words it is not being reconized as a bat file can i please have some help
 
Solution
Find out where your Java is installed, it will either be in C:\Program Files\Java or C:\Program Files (x86)\Java by default, unless you changed it of course.
Go to Control Panel, then System, then Advanced system settings on the left had side. Advanced tab, Environment Variables... near the bottom. On the bottom half under System variables, hit the New... button.

If your Java is under Program Files, then fill the two boxes like:
PATH
C:\Program Files\Java\jre7\bin

If your Java is under Program Files (x86), then enter the following into the fields:
PATH
C:\Program Files (x86)\Java\jre7\bin

Hit OK, OK, OK, and then launch the batch file. The reason it isn't working is because the Java installer doesn't create the variable...

navysealbrian

Distinguished
Jan 18, 2006
214
0
18,760
First try to make the first part in your batch file java.exe, if that doesn't work, then do the following.
Get into Control Panel, then System (shortcut: Windows key + Pause/Break button next to Scroll Lock). Advanced tab, Environment Variables, under System variables, hit New... put PATH for Variable name, and depending on whether you have 32 or 64 bit Java installed, C:\Program Files (x86)\Java\jre7\bin for 32 bit or C:\Program Files\Java\jre7\bin for 64 bit for the Variable value.
 

navysealbrian

Distinguished
Jan 18, 2006
214
0
18,760
Find out where your Java is installed, it will either be in C:\Program Files\Java or C:\Program Files (x86)\Java by default, unless you changed it of course.
Go to Control Panel, then System, then Advanced system settings on the left had side. Advanced tab, Environment Variables... near the bottom. On the bottom half under System variables, hit the New... button.

If your Java is under Program Files, then fill the two boxes like:
PATH
C:\Program Files\Java\jre7\bin

If your Java is under Program Files (x86), then enter the following into the fields:
PATH
C:\Program Files (x86)\Java\jre7\bin

Hit OK, OK, OK, and then launch the batch file. The reason it isn't working is because the Java installer doesn't create the variable, therefore, command prompt doesn't know what Java is. So you're telling it to run Minecraft through Java, but it doesn't know where Java is.
 
Solution