Jump to content

Recommended Posts

Posted

I am trying to set up all of the post-SP2 updates to run when I execute a batch file located on a external USB HD. I am having problems getting the batch file set up to so it will reconize the drive letter of the external HD. I haven't made that many batch files, so I guess you can call me a n00b. Thanks for the help.


Posted (edited)

In your batch that is located on your external HDD you could use the following line:

set usbpath=%~dp0

At the end of your batch you should insert the line:

set usbpath=

or you have to work with setlocal and endlocal

Then %USBPATH% is the variable, which contains the path to the directory, the batch lies in, so in this case your external HDD.

Hope this helps.

Edited by Doc Symbiosis
Posted

yeah, that helped. I found another way to do it instead of doing it the way I wa thinking.

@echo off

echo This will install Post-SP2 updates...
pause

echo Installing Windows2000-KB899587-x86-ENU
..\WindowsUpdates\Windows2000-KB899587-x86-ENU.exe /passive /norestart

echo Installing WindowsInstaller-KB893803-v2-x86
..\WindowsUpdates\WindowsInstaller-KB893803-v2-x86.exe /passive /norestart

echo Installing Windows-KB890830-V1.7A-ENU
..\WindowsUpdates\Windows-KB890830-V1.7A-ENU.exe /q

echo Installing WindowsXP-KB873333-x86-ENU
..\WindowsUpdates\WindowsXP-KB873333-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB873339-x86-ENU
..\WindowsUpdates\WindowsXP-KB873339-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB885250-x86-ENU
..\WindowsUpdates\WindowsXP-KB885250-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB885835-x86-ENU
..\WindowsUpdates\WindowsXP-KB885835-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB885836-x86-ENU
..\WindowsUpdates\WindowsXP-KB885836-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB885884-x86-enu
..\WindowsUpdates\WindowsXP-KB885884-x86-enu.exe /passive /norestart

echo Installing WindowsXP-KB886185-x86-enu
..\WindowsUpdates\WindowsXP-KB886185-x86-enu.exe /passive /norestart

echo Installing WindowsXP-KB887472-x86-enu
..\WindowsUpdates\WindowsXP-KB887472-x86-enu.exe /passive /norestart  

echo Installing WindowsXP-KB887742-x86-ENU
..\WindowsUpdate\WindowsXP-KB887742-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB888113-x86-ENU
..\WindowsUpdate\WindowsXP-KB888113-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB888302-x86-ENU
..\WindowsUpdates\WindowsXP-KB888302-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB890046-x86-ENU
..\WindowsUpdates\WindowsXP-KB890046-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB890859-x86-ENU
..\WindowsUpdates\WindowsXP-KB890859-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB891781-x86-ENU
..\WindowsUpdates\WindowsXP-KB891781-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB893066-v2-x86-ENU
..\WindowsUpdates\WindowsXP-KB893066-v2-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB893086-x86-ENU
..\WindowsUpdates\WindowsXP-KB893086-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB893756-x86-ENU
..\WindowsUpdates\WindowsXP-KB893756-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB894391-x86-ENU
..\WindowsUpdates\WindowsXP-KB894391-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB896344-v2-x86-ENU
..\WindowsUpdates\WindowsXP-KB896344-v2-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB896358-x86-ENU
..\WindowsUpdates\WindowsXP-KB896358-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB896422-x86-ENU
..\WindowsUpdates\WindowsXP-KB896422-x86-ENU.exe /passive /norestar

echo Installing WindowsXP-KB896423-x86-ENU
..\WindowsUpdates\WindowsXP-KB896423-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB896428-x86-ENU
..\WindowsUpdates\WindowsXP-KB896428-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB896727-x86-ENU
..\WindowsUpdates\WindowsXP-KB896727-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB898461-x86-ENU
..\WindowsUpdates\WindowsXP-KB898461-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB899587-x86-ENU
..\WindowsUpdates\WindowsXP-KB899587-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB899588-x86-ENU
..\WindowsUpdates\WindowsXP-KB899588-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB899591-x86-ENU
..\WindowsUpdates\WindowsXP-KB899591-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB900930-x86-ENU
..\WindowsUpdates\WindowsXP-KB900930-x86-ENU.exe /passive /norestart

echo Installing WindowsXP-KB901214-x86-ENU
..\WindowsUpdates\WindowsXP-KB901214-x86-ENU.exe /passive /norestart

echo Installing .Net Framework 1.1
..\WindowsUpdates\dotnetfx.exe /Q

echo Installing NDP1.1sp1-KB867460-X86
..\WindowsUpdates\NDP1.1sp1-KB867460-X86.exe /Q

echo Installing NDP1.1sp1-KB886903-X86
..\WindowsUpdates\NDP1.1sp1-KB886903-X86.exe /Q

echo Installing HMTCDWizard_enu.exe
..\WindowsUpdates\HMTCDWizard_enu.exe /passive /norestart

echo Installing Microsoft GDI+ Detection Tool
..\WindowsUpdates\gdidettool.exe /Q

echo Reboot the machine...
pause

If you have any ideas on how I can do this better...please let me know. Thanks.

Posted (edited)

You can use the great "for" command ...

@echo off
echo Installing hotfixes ...
cd /d "%~dp0"
for %%a in (*.exe) do (
Start /wait "" %%a /passive /norestart )
echo Reboot the machine
pause

You need to paste it in the new cmd file into the same directory of the hotfixes ...

Goodbye.

Edited by sonic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...