Help Silently Installing Java Version 6 Update 29

I have a script I cannot get to work and I've tried all sorts of suggestions from websites and don't know what I'm doing wrong.  

I need to silently install Java Version 6 update 29, but when I try /s or /v" or /qn nothing seems to work.  The program never installs.  I would preferably like this script to work on Windows 7 as well as XP.

THANKS!

CODE:
------------------------------------------

@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls

:PreSetUp -V6.3 installation
  :: check for environment pre-setup requirements on local machine
  cls

:variables
  :: setup stable environment variables
  SET A_DIR=C:\Docume~1\AllUse~1\Desktop
  SET U_DIR=C:\Docume~1\%username%\Desktop
  SET J_DIR=C:\Docume~1\%username%\Applic~1\Sun\Java\Deployment
  SET D_FAV="C:\Documents and Settings\Default User\Favorites"
  SET U_FAV="C:\Documents and Settings\%username%\Favorites" goto Message1

:Message1
  :: installation message
    echo.
    echo    --------------------------------------------------
    echo    ^|                                                ^|
    echo    ^|         This program is installing the         ^|
    echo    ^|        required components for using the       ^|
    echo    ^|           Kronos WFC Timekeeping systems          ^|
    echo    ^|               on your computer.                ^|
    echo    ^|                                                ^|
    echo    ^|    Please wait while installation continues    ^|
    echo    ^|                                                ^|
    echo    --------------------------------------------------
    echo.  


:JRE Install file copy
echo -------Starting  Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kronos\JRE6029\jre-6u29-windows-i586.exe"  %windir%\Temp >nul 2>&1
copy /Y  "\\servername\Install\Kronos\JRE6029\JavaUpdateOFF.reg" %windir%\Temp >nul 2>&1

"%windir%\Temp\jre-6u29-windows-i586.exe" /s
regedit /s %windir%\Temp\JavaUpdateOFF.reg

@Echo Off

echo deployment.javaws.autodownload=NEVER  >>%J_DIR%\deployment.properties

goto end

:end
  :: finishing script and cleanup
  :: show message prompt telling user that update has finished
  echo.
  echo    --------------------------------------------------
  echo    ^|                                                ^|
  echo    ^|     Your Kronos Client update is finished now!      ^|
  echo    ^|                                                ^|
  echo    ^|                   Good Bye!                    ^|
  echo    ^|                                                ^|
  echo    --------------------------------------------------
  echo.
  echo.

:end2clear
  :: clear temp variables
  SET A_DIR=
  SET U_DIR=
  :: delete common temp files from computer
  del %temp%\~*.* /f /q >nul 2>&1
  del %temp%\*.tmp /f /q >nul 2>&1
  del %tmp%\~*.* /f /q >nul 2>&1
  del %tmp%\*.tmp /f /q >nul 2>&1
  :: ALL PROCESSES ARE FINISHED NOW!
  :: pause for user prompt to strike a key to acknowledge end
pause
  :: force exit from script
color
exit
Taylor HuckstepSenior Director, ITAsked:
Who is Participating?
 
CEHJCommented:
Please rename with a .bat extension and run the attached batch file (made a little less silent) from the command line and let us know what happens.
less-silent.txt
0
 
CEHJCommented:
You're presumably attempting this only with Admin privileges?
0
 
Taylor HuckstepSenior Director, ITAuthor Commented:
Yes, all users have local admin.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Taylor HuckstepSenior Director, ITAuthor Commented:
That worked!  I don't know what you changed to make it work, I'm going to compare it to my script, but it installed successfully.

I did get it throwing a bunch of access denied errors at the end, maybe when it tried deleting the tmp files?  Any ideas why?

C:\DOCUME~1\huckst\LOCALS~1\Temp\~DFB1E.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~1\Temp\~DFB23.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~1\Temp\~DFB8E3.tmp
Access is denied.
...etc...
Press any key to continue . . .

Regardless, thanks for the help!  Today started off bad as my pet tarantula escaped her cage this morning and is loose in my house.
0
 
Taylor HuckstepSenior Director, ITAuthor Commented:
I see you removed >nul 2>&1 which is no big deal at all.  Thanks again for the help!
0
 
CEHJCommented:
Those files might be locked still. They're just really warnings that can be ignored. That's why >nul was used.

Moral of the story: don't double-click a batch file to run it unless you're 100% certain it's going to work ;)
0
 
Taylor HuckstepSenior Director, ITAuthor Commented:
or run it on a test system you don't care about losing :)

I did look over the code to make sure you didn't add in a little sneaky surprise :)

I just removed the deletion of temp files, I don't know that that's necessary.

Weird that removing the nul parameters made it work, but thanks for your help!
0
 
CEHJCommented:
I suspect that it was something other than the nul thing really.
0
 
Taylor HuckstepSenior Director, ITAuthor Commented:
Contents of the script:

@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls

:PreSetUp -V6.3 installation
:: check for environment pre-setup requirements on local machine
cls

:variables
:: setup stable environment variables
SET A_DIR=C:\Docume~1\AllUse~1\Desktop
SET U_DIR=C:\Docume~1\%username%\Desktop
SET J_DIR=C:\Docume~1\%username%\Applic~1\Sun\Java\Deployment
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favorites" goto Message1

:Message1
:: installation message
echo.
echo    --------------------------------------------------
echo    ^|                                                ^|
echo    ^|         This program is installing the         ^|
echo    ^|        required components for using the       ^|
echo    ^|           Kronos WFC Timekeeping systems          ^|
echo    ^|               on your computer.                ^|
echo    ^|                                                ^|
echo    ^|    Please wait while installation continues    ^|
echo    ^|                                                ^|
echo    --------------------------------------------------
echo.  


:JRE Install file copy
echo -------Starting  Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kronos\JRE6029\jre-6u29-windows-i586.exe"  %windir%\Temp
copy /Y  "\\servername\Install\Kronos\JRE6029\JavaUpdateOFF.reg" %windir%\Temp

"%windir%\Temp\jre-6u29-windows-i586.exe" /s
regedit /s %windir%\Temp\JavaUpdateOFF.reg

@Echo Off

echo deployment.javaws.autodownload=NEVER  >>%J_DIR%\deployment.properties

goto end

:end
:: finishing script and cleanup
:: show message prompt telling user that update has finished
echo.
echo    --------------------------------------------------
echo    ^|                                                ^|
echo    ^|     Your update is finished now! ^|
echo    ^|                                                ^|
echo    ^|                   Good Bye!                    ^|
echo    ^|                                                ^|
echo    --------------------------------------------------
echo.
echo.

:end2clear
:: clear temp variables
SET A_DIR=
SET U_DIR=
:: delete common temp files from computer
del %temp%\~*.* /f /q
del %temp%\*.tmp /f /q
del %tmp%\~*.* /f /q
del %tmp%\*.tmp /f /q
:: ALL PROCESSES ARE FINISHED NOW!
:: pause for user prompt to strike a key to acknowledge end
pause
:: force exit from script
color
exit
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.