Batch File is not working correctly

Hey Everyone,

 

I've got a batch file that I'm trying to get to work and seem to be running into difficulties on getting the whole batch file to work. I'm guessing that I have something missing or incorrect. :) What I'm trying to accomplish is we currently have Java versions 7.0.45 both x64 & x86 platforms installs on all production client machines. My batch file will uninstall the x86 version of Java 7.0.45 and theninstall the latest version of Java 7.0.51 x86 without any problems. It's the x64 that my batch file is running into problems and does not uninstall it or install the new version of java (7.0.51 x64).

 

 

Here's what my batch file looks like:

 

@ECHO OFF cls :KillIE&JavaProcesses echo *** This will kill Browsers and Java Processes *** Rem *** taskkill /F /IM iexplorer.exe taskkill /F /IM iexplore.exe taskkill /F /IM firefox.exe taskkill /F /IM chrome.exe taskkill /F /IM jusched.exe taskkill /F /IM jp2launcher.exe taskkill /F /IM java.exe taskkill /F /IM javaw.exe taskkill /F /IM jqs.exe   rem cd x64 rem msiexec.exe /i jre1.7.0_51.msi /qn AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 EULA=1 /NORESTART /log c:\java_7_51_x64_install.log   rem cmd.exe /C rmdir "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java" /S/q   rem cd..   cd x86 msiexec.exe /i jre1.7.0_51.msi /qn AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 EULA=1 /NORESTART /log c:\java_7_51_x86_install.log   cmd.exe /C rmdir "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java" /S/q         The CM 2012 exemgr log shows that the batch file installed successfully. Please help.     Thanks!
January 29th, 2014 4:10pm

Can't really tell without you posting more details. Here are a few pointers:

  • Don't use relative paths such as CD X86. Use absolute paths instead: CD F:\X86.
  • There is no process called "iexplorer.exe". It should be "iexplore.exe".
  • What is the point of spawning an extra command processor to remove a folder?
  • Why do you try to delete the Java folder twice?
  • Did you invoke the batch file from a Console so that you can see the messages it generates?
  • What were these messages?
  • Did you run the batch file under elevated admin privileges?

Try this version:

@ECHO OFF
echo *** This will kill Browsers and Java Processes ***
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM jusched.exe
taskkill /F /IM jp2launcher.exe
taskkill /F /IM java.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
 
cd /d "F:\x64"
msiexec.exe /i jre1.7.0_51.msi /qn AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 EULA=1 /NORESTART /log c:\java_7_51_x64_install.log
rmdir "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java" /S/q
 
cd /d "F:\x86"
msiexec.exe /i jre1.7.0_51.msi /qn AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 EULA=1 /NORESTART /log c:\java_7_51_x86_install.log
rem ??? rmdir "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java" /S/q




Free Windows Admin Tool Kit Click here and download it now
January 29th, 2014 4:39pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics