I am using a simple batch file that un-install's java but it is not compleley hidden.  I would like to push the batch file without the command prompt popping up while it runs on windows 7.  Any Ideas?

Answer Summary:
0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer


I've used this as a work around. It'll take your .bat and create an exe. Then just deploy the exe.


Answered 01/24/2013 by: dugullett
Red Belt

  • I read further down that this didn't work for you? Just curious where it failed at? I use this quite frequently. Did you include the .txt file in your package?
    • I changed the bat file to call on the txt file where it get's downloaded in C:\ProgramData\Dell\KACE\downloads. It pushes it to the system but never launches the exe to un-install. Also I notice when it get's push there is no .exe at the end of the application just the name.
      • Can you post the script you are using? I might be able to help.

        You should be able to include the .txt file in the package by clicking the include button and adding it. When it's done you should just be able to run the exe manually on the machine and it should work. Then after you confirmed it's worked include it in your Kace script.

        Launch a Program.....
        Directory: $(KACE_DEPENDENCY_DIR)
        File: <Name_of_EXE>.exe
    • This content is currently hidden from public view.
      Reason: Spam
      For more information, visit our FAQ's.
    • This content is currently hidden from public view.
      Reason: Spam
      For more information, visit our FAQ's.
  • Thank you Dugullet for the help! Below is the script:

    @echo off
    echo Removing previous JRE versions

    for /f %%a in (jre-uninstall-list.txt) do MsiExec.exe /uninstall %%a /passive /quiet

    Below is what is in the txt file named (jre-uninstall-list.txt):
    • You're going to have to help me out here since I don't have test machines with these versions, but I'm assuming this script works when ran on a machine manually?

      You mentioned that you changed the bat file to call on the txt @ c:\programdata\Dell\Kace. How are you currently deploying this script in Kace? Adding both the exe and the txt as dependencies?

      Try this. Include that txt file as part of the package when using the bat to exe converter. It should create the exe and work with exactly what you have there. Don't worry about entering a path. One thing I do suggest it check marking the "Overwrite existing Files" on the main screen on the converter. Make sure to test the exe first on a test machine before even worrying about adding it to Kace. If done correctly it should uninstall JRE.

      Also it from what AbhayR is saying it will not happen anymore with 5.4 using MIs. I can't speak for that because I haven't updated yet, but he's very knowledgable.
Please log in to comment



I had to do a new answer for the pic. The save as field is where your exe should turn up. If you click the include tab, and at the bottom hit add. Then browse to your txt file. After all of your files have been added then compile. 

I've had success with deploying the exe to multiple systems. What did you mean by "cannot be pushed to multiple"? Also in your bat that your are using make sure that there's not a path to reference your txt file. Just leave it as you have it. 

Answered 01/30/2013 by: dugullett
Red Belt

  • Thanks Dugullett, I did as you suggested and include the txt file. I then tried to run the exe locally on the test machine and it did not work. Not sure what I am doing wrong here? I really appeciate all the help with this.
    • Does your bat that you are using match the one exactly above? I've never used variables, but it should still work.

      Mine usually go something like this.

      @echo off
      msiexec /i test.msi /qn
      msiexec /i test1.msi /qn
      copy /y file.txt c:\temp

      I then include test.msi, test1.msi, and file.txt. Notice how I don't reference any paths.
      • Dugullet you are a genius! Just for testing I put the exe into manged install push it to two test machine and it worked perfect! Now if only I can find out the uninstall key for Java 7 update 11... Thank you very much!!!
      • Glad it worked. MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83217011FF} should work for update 11.
  • Duguleet - quick question I pushed this out to 5 systems all worked but one automatically restarted. Should I add a /qn to the configure manually to completely supress it 100 percent from restarting? javauninstall.exe /QN ? This is the call command I have in the managed installation...for configure manually...
    • It should be REBOOT=reallysuppress.

      qn/ would just suppress the entire uninstall. It will not stop the reboot.
      • So I would add javauninstall.exe /reboot=supress correct? or
        javauninstall.exe reboot=supress... Sorry to keep buggin you with this but this should be the final question... Thanks alot!
      • You will need to add it to your bat before compiling. REBOOT=suppress will still prompt users the majority of the time. REBOOT=reallysuppress is probably more what you want.

        do MsiExec.exe /uninstall %%a /passive /quiet REBOOT=reallysuppress
  • Where would you suggest I add it to this bat file? at the end of the script after /quiet /reboot=reallysupress

    @echo off
    echo Removing previous JRE versions

    for /f %%a in (jre-uninstall-list.txt) do MsiExec.exe /uninstall %%a /passive /quiet
    • I edited my original comment. Make sure not to misspell suppress or it will not work.
      • Thanks again for all the help Dugullett, very much appreciated!
      • Dugullet I figured I would try to reach out to you since you were able to help me figure out the java 7 un-install... Have you been able to do something like this where it un-install Java 7 and installs Java 6? I would like to package up the same way so it's 100% silent using the f20 software you suggested.
  • I have not, but I would assume you could have the uninstall string for Java 7 listed first, and then run the install for Java 6. There will probably need to be a reboot in there somewhere. We're still on JRE 5 here for some legacy apps we're waiting to die off.
    • Got it thanks...
Please log in to comment

here is another one I have used


or you can create a vbs script also


CreateObject("Wscript.Shell").Run "your_batch_file.bat", 0, True

Answered 01/24/2013 by: SMal.tmcc
Red Belt

Please log in to comment

Here is a script that will remove the previous versions of Java and install Java 7 update 11!



Answered 01/31/2013 by: c_brock
Third Degree Brown Belt

Please log in to comment

What version of K1000 are you on?

If you are on 5.4 and using the Managed Installation to execute the batch file then you shouldn't get command prompt popping on console.

Answered 01/24/2013 by: AbhayR
Fourth Degree Black Belt

Please log in to comment

Thank you all for the information.  My next question is; has anyone pushed Java 7 update 11 through managed install silently in KACE and if so how do you get it the install to where when a user openes up a site that uses Java it automatically selects the latest version without prompting the user to select the old or new version?

Answered 01/24/2013 by: rchung
Brown Belt

  • You can also use iexpress.exe, which is built into Windows, to convert your batch to an .exe. Do a call /c batch for the dependancy.

    This should answer your Java questions: http://www.itninja.com/blog/view/deploying-32-bit-java-silently-to-both-32-bit-and-64-bit-windows-via-mi
    • SDNBTP is there instructions on how to use iexpress.exe to convert the bat to an .exe? Also my bat calls on a txt file so it knows the exact un-install key to remove java 7 update 8, 9, etc... I tried all the others suggestions but it still prompts the command prompt or simly does not work.
    • SDNTP - when you state do a call /c batch what do you mean exactly? Would I put this into the manage install?
Please log in to comment
Answer this question or Comment on this question for clarity