This is a batch file I created to remove unwanted hardware and software from a machine. We use Ghost images with SysPrep to consolidate an image that works on all models of machines (Desktop/Laptops) within our corporation. I use specific batch files like this one to remove unwanted hardware and software from a machine once they have been re-imaged.
I like script and batch files that are well documented??.a bad habit I picked up since the early eighties programming PCL Logic and CNC logic. Every admin. should be using scripting and batch programming no mater what OS or TTL logic they run.
This batch calls specific hardware and software that indigenous to our corporate environment but you get the idea of the logic. I have since corrected the images to load only the specific hardware on a specific machine. I still use a modification of this batch file to remove unwanted software. Batches and Scripts are the savior of repetitive tasks in our logical world.
This batch file removes applications that are not used on desktops by uninstalling the program through
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall registry key.
echo ****************************************************************
echo * This batch file will remove apps not used on a desktop image *
echo * If you have any questions please contact a member of the *
echo * Hardware Team for help
echo * DO NOT REBOOT DURNING THESE UNISTALLS. *
echo * WAIT TILL DOS SCREEN SAYS "PLEASE REBOOT SYSTEM NOW "
echo ****************************************************************
pause
:Removes Toshiba Software Modem
s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Info2'
:Removes Conexant D480 MDC V.92 Modem
C:\Program Files\CONEXANT\CNXT_MODEM_PCI_VEN_8086&DEV_24x6&SUBSYS_542214F1\HXFSETUP.EXE -U -Idel5422k.inf
:Removes S3Info2
s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Info2'
:Removes S3Gamma2
s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Gamma2'
:Removes S3Display
s3uninst.exe -reg 5 'HKLM\Software\S3\S3Uninst\S3Display'
:Removes Broadcom Driver Installer
C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\7\INTEL3~1\IDriver.exe /M{BE6890C7-31EF-478C-812E-1E2899ABFCA9} /l1033
:Removes Broadcom ASF Management Applications
C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\7\INTEL3~1\IDriver.exe /M{25D24E84-64A9-40D2-85CF-540B1C4A6D52} /l1033
:Removes Access Finder 3.3
C:\WINDOWS\ISUNINST.EXE -f"C:\Program Files\XO Communications\Access Finder\Uninst.isu" -c"C:\Program Files\XO Communications\Access Finder\Uninst.dll"
:Removes Dell ResourceCD
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{D78653C3-A8FF-415F-92E6-D774E634FF2D}\setup.exe"
:Removes QuickSet
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{C5074CC4-0E26-4716-A307-960272A90040}\setup.exe" -l0x9
:Removes ALPS Touch Pad Driver
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{9F72EF8B-AEC9-4CA5-B483-143980AFD6FD}\setup.exe" UNINSTALL
:Removes Cisco Systems VPN Client 3.6.6.a (Rel)
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{5624C000-B109-11D4-9DB4-00E0290FCAC5}\Setup.exe" -l0x9 VpnUninstall
:Removes Cisco Systems VPN Client 3.6.6.a folder from HD
RMDIR /s /q c:\PROGRA~1\CISCOS~1\
:Removes Cisco Systems VPN Client 3.6.6.a icon from desktop
del "C:\Documents and Settings\All Users\Desktop\VPN Client.lnk"
:Removes Compaq Wireless LAN
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\0701\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{70563F48-07E8-4AD0-B3FB-23257E5C8B72}\setup.exe" -l0x9 -a
:Removes SigmaTel AC97 Audio Drivers
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\0701\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{7959721D-8268-4565-9E0E-C41A9F4848A9}\setup.exe" -l0x9 -nodialog -uninstall
:Removes DVD-RAM Driver
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{9D765FA6-F2BC-40AF-8145-50808F9BDF4E}\Setup.exe" DVD-RAM Driver
:Removes Compaq Client Manager
RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\0701\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{EDC2FD00-D743-11D4-969D-0060B0FBF2F6}\setup.exe" -l0x9 -a
:Removes TOSHIBA Software Modem
Tosmreg -SU
:Removes ATI Video Drivers
rundll32 C:\WINDOWS\System32\atiiiexx.dll,_InfEngUnInstallINFFile_RunDLL@16 -force_restart -flags:0x2010001 -inf_class:DISPLAY -clean
:Removes ATI Video Software
C:\Program Files\ATI Technologies\UninstallAll\AtiCimUn.exe
pause
echo PLEASE REBOOT SYSTEM WHEN YOUR READY!
pause
:quit