/build/static/layout/Breadcrumb_cap_w.png

How do I stop a command prompt from popping up when pushing a batch file from KACE

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?


0 Comments   [ + ] Show comments

Answers (6)

Answer Summary:
Posted by: dugullett 11 years ago
Red Belt
5

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

http://www.f2ko.de/programs.php?lang=en&pid=b2e


Comments:
  • 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? - dugullett 11 years ago
    • 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. - rchung 11 years ago
      • 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 - dugullett 11 years ago
  • 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):
    {26A24AE4-039D-4CA4-87B4-2F83217007FF}
    {26A24AE4-039D-4CA4-87B4-2F86417007FF}
    {26A24AE4-039D-4CA4-87B4-2F86417006FF}
    {26A24AE4-039D-4CA4-87B4-2F83217006FF}
    {26A24AE4-039D-4CA4-87B4-2F86417010FF}
    {26A24AE4-039D-4CA4-87B4-2F83217010FF}
    {26A24AE4-039D-4CA4-87B4-2F83217009FF}
    {26A24AE4-039D-4CA4-87B4-2F86417011FF} - rchung 11 years ago
    • 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. - dugullett 11 years ago
Posted by: dugullett 11 years ago
Red Belt
1

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. 


Comments:
  • 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. - rchung 11 years ago
    • 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
      exit

      I then include test.msi, test1.msi, and file.txt. Notice how I don't reference any paths. - dugullett 11 years ago
      • 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!!! - rchung 11 years ago
      • Glad it worked. MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83217011FF} should work for update 11. - dugullett 11 years ago
  • 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... - rchung 11 years ago
    • It should be REBOOT=reallysuppress.

      qn/ would just suppress the entire uninstall. It will not stop the reboot. - dugullett 11 years ago
      • 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! - rchung 11 years ago
      • 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 - dugullett 11 years ago
  • 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 - rchung 11 years ago
    • I edited my original comment. Make sure not to misspell suppress or it will not work. - dugullett 11 years ago
      • Thanks again for all the help Dugullett, very much appreciated! - rchung 11 years ago
      • 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. - rchung 11 years ago
  • 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. - dugullett 11 years ago
    • Got it thanks... - rchung 11 years ago
Posted by: SMal.tmcc 11 years ago
Red Belt
0

here is another one I have used

http://www.commandline.co.uk/chp/

or you can create a vbs script also

'HideBat.vbs

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

Posted by: c_brock 11 years ago
Third Degree Brown Belt
0

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

http://www.itninja.com/blog/view/kace-install-java-7-update-11-using-a-script-removes-previous-versions

 

Posted by: AbhayR 11 years ago
Red Belt
0

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.

Posted by: rchung 11 years ago
Brown Belt
0

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?


Comments:
  • 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 11 years ago
    • 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. - rchung 11 years ago
    • SDNTP - when you state do a call /c batch what do you mean exactly? Would I put this into the manage install? - rchung 11 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ