Computer Hope

Microsoft => Microsoft DOS => Topic started by: mafkees on January 03, 2012, 04:39:39 AM

Title: Batch file to export a .txt of the Add/Remove Programs list in Windows
Post by: mafkees on January 03, 2012, 04:39:39 AM
I searched a lot for a batchfile that could export a list to a text file of all the installed programs on my machine. I want the list as similar as possible to the 'visual' list of the Add/Remove Programs in Windows.

What i got till now is a batch file that export a list from 3 different registerkeys (which is suggested from search on Google to be the ones that contains all the programs). After that, I check for double lines and remove those double lines.

Finally, with the findstr option I can filter lots of updates like all the Microsoft 'KB' options out.

The batch file so far:

Code: [Select]
@echo off
If Exist C:\Final.txt Del C:\Final.txt
regedit /e C:\regexport.txt "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
regedit /e C:\regexport2.txt "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall"
regedit /e C:\regexport3.txt "HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
find "DisplayName" C:\regexport.txt > C:\regprogs.txt
find "DisplayName" C:\regexport2.txt >> C:\regprogs.txt
find "DisplayName" C:\regexport3.txt >> C:\regprogs.txt
for /f "tokens=2 delims==" %%a in (C:\regprogs.txt) do echo %%~a >> C:\installedprogs.txt
del C:\regexport.txt
del C:\regexport2.txt
del C:\regexport3.txt
del C:\regprogs.txt
sort C:\installedprogs.txt > C:\alles.txt
del C:\installedprogs.txt


:: script om alle dubbele lijnen eruit te gooien
REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL EnABLEDELAYEDEXPANSION

REM -- Prepare the Prompt for easy debugging -- restore with prompt=$p$g
prompt=$g

rem The finished program will remove duplicates lines

:START
set "_duplicates=TRUE"

set "_infile=C:\alles.txt"
set                        "_oldstr=the"
set                                    "_newstr=and"

call :BATCHSUBSTITUTE %_infile% %_oldstr% %_newstr%
pause
goto :SHOWINTELL
goto :eof


:BATCHSUBSTITUTE

type nul> %TEMP%.\TEMP.DAT

if "%~2"=="" findstr "^::" "%~f0"&GOTO:EOF
for /f "tokens=1,* delims=]" %%A in ('"type %1|find /n /v """') do (
    set "_line=%%B"
    if defined _line (
        if "%_duplicates%"=="TRUE" (
            set "_unconverted=!_line!"
            set "_converted=!_line:"=""!"
            FIND "!_converted!" %TEMP%.\TEMP.DAT > nul
            if errorlevel==1 (
                >> %TEMP%.\TEMP.DAT echo !_unconverted!
            )
        )
    ) ELSE (
        echo(>> %TEMP%.\TEMP.DAT
    )
)
goto :eof


:SHOWINTELL
@echo A|move %TEMP%.\TEMP.DAT C:\allesnietdubbel.txt
del C:\alles.txt

::Alle lijnen weggooien waar 'KB' in voor komt
type C:\allesnietdubbel.txt | findstr /V KB > C:\Final.txt
goto :eof



exit

Final.txt

Code: [Select]
@C:\\Program Files (x86)\\Windows Live\\Installer\\wlsres.dll,-3002
@C:\\windows\\system32\\bcmwlrc.dll,-4003
3CXPhone
64 Bit HP CIO Components Installer
ActivClient x64
ActiveCheck component for HP Active Support Library
Adobe Flash Player 10 ActiveX
Adobe Flash Player 10 ActiveX 64-bit
Adobe Reader X (10.1.1) - Nederlands
Apple Application Support
Apple Mobile Device Support
Apple Software Update
ATI Catalyst Install Manager
AVG 2011
Babylon
Babylon toolbar on IE
Belarc Advisor 8.2
Bonjour
Borland Database Engine Setup
Broadcom 2070 Bluetooth 2.1 + EDR
Broadcom 802.11 Wireless LAN Adapter
Catalyst Control Center - Branding
Catalyst Control Center Core Implementation
Catalyst Control Center Graphics Full Existing
Catalyst Control Center Graphics Full New
Catalyst Control Center Graphics Light
Catalyst Control Center InstallProxy
Catalyst Control Center Localization All
ccc-core-static
ccc-utility64
CCC Help Chinese Standard
CCC Help Chinese Traditional
CCC Help Czech
CCC Help Danish
CCC Help Dutch
CCC Help English
CCC Help Finnish
CCC Help French
CCC Help German
CCC Help Greek
CCC Help Hungarian
CCC Help Italian
CCC Help Japanese
CCC Help Korean
CCC Help Norwegian
CCC Help Polish
CCC Help Portuguese
CCC Help Russian
CCC Help Spanish
CCC Help Swedish
CCC Help Thai
CCC Help Turkish
Citrix online plug-in - web
Citrix online plug-in (DV)
Citrix online plug-in (HDX)
Citrix online plug-in (USB)
Citrix online plug-in (Web)
Citrix XenCenter
Citrix XenConvert_x64
Corel Graphics - Windows Shell Extension
Corel Graphics - Windows Shell Extension 64 Bit
CorelDRAW Graphics Suite X5
CorelDRAW Graphics Suite X5 - Capture
CorelDRAW Graphics Suite X5 - Common
CorelDRAW Graphics Suite X5 - Connect
CorelDRAW Graphics Suite X5 - Custom Data
CorelDRAW Graphics Suite X5 - Draw
CorelDRAW Graphics Suite X5 - Filters
CorelDRAW Graphics Suite X5 - FontNav
CorelDRAW Graphics Suite X5 - IPM
CorelDRAW Graphics Suite X5 - NL
CorelDRAW Graphics Suite X5 - PHOTO-PAINT
CorelDRAW Graphics Suite X5 - Photozoom Plugin
CorelDRAW Graphics Suite X5 - Redist
CorelDRAW Graphics Suite X5 - Setup Files
CorelDRAW Graphics Suite X5 - VBA
CorelDRAW Graphics Suite X5 - VideoBrowser
CorelDRAW Graphics Suite X5 - VSTA
CorelDRAW Graphics Suite X5 - WT
CorelDRAW(R) Graphics Suite X5
CuteFTP 8 Home
D3DX10
Device Access Manager for HP ProtectTools
DirectX 9 Runtime
Drive Encryption for HP ProtectTools
Energy Star Digital Logo
File Sanitizer For HP ProtectTools
FileZilla Client 3.3.5.1
HP 3D DriveGuard
HP Customer Experience Enhancements
HP ESU for Microsoft Windows 7
HP HotKey Support
HP Install Network Printer Wizard
HP Power Assistant
HP Power Data
HP ProtectTools Security Manager
HP QuickLook
HP QuickWeb
HP Setup
HP SoftPaq Download Manager
HP Software Framework
HP Software Setup
HP Support Assistant
HP User Guides 0185
HP Web Camera
HP Webcam
HP Wireless Assistant
HPAsset component for HP Active Support Library
IDT Audio
iTunes
Java Auto Updater
Java Card Security for HP ProtectTools
Java(TM) 6 Update 26
Junk Mail filter update
jZip
LightScribe System Software
LSI HDA Modem
LVI MagniLink S OCR
MagniLink Read
Mamut Business Software
Marvell Miniport Driver
Mesh Runtime
Messenger Companion
Microsoft .NET Framework 4 Client Profile
Microsoft .NET Framework 4 Client Profile NLD Language Pack
Microsoft .NET Framework 4 Extended
Microsoft Application Error Reporting
Microsoft Office 2010 Service Pack 1 (SP1)
Microsoft Office 2010 voor Thuisgebruik en Zakelijke toepassingen
Microsoft Office Access MUI (Dutch) 2010
Microsoft Office Excel MUI (Dutch) 2010
Microsoft Office Office 64-bit Components 2010
Microsoft Office OneNote MUI (Dutch) 2010
Microsoft Office Outlook Connector
Microsoft Office Outlook MUI (Dutch) 2010
Microsoft Office PowerPoint MUI (Dutch) 2010
Microsoft Office Proof (Dutch) 2010
Microsoft Office Proof (English) 2010
Microsoft Office Proof (French) 2010
Microsoft Office Proof (German) 2010
Microsoft Office Proofing (Dutch) 2010
Microsoft Office Publisher MUI (Dutch) 2010
Microsoft Office Shared 64-bit MUI (Dutch) 2010
Microsoft Office Shared MUI (Dutch) 2010
Microsoft Office Single Image 2010
Microsoft Office Suite Activation Assistant
Microsoft Office Word MUI (Dutch) 2010
Microsoft Search Enhancement Pack
Microsoft Silverlight
Microsoft SQL Server 2005 Compact Edition [ENU]
Microsoft SQL Server 2008 R2
Microsoft SQL Server 2008 R2 Native Client
Microsoft SQL Server 2008 R2 RsFx Driver
Microsoft SQL Server 2008 R2 Setup (English)
Microsoft SQL Server 2008 Setup Support Files 
Microsoft SQL Server Browser
Microsoft SQL Server PowerPivot for Excel (32-bits)
Microsoft SQL Server VSS Writer
Microsoft Sync Framework 2.1 Core Components (x86) ENU 
Microsoft Visual C++ 2005 ATL Update kb973923 - x64 8.0.50727.4053
Microsoft Visual C++ 2005 ATL Update kb973923 - x86 8.0.50727.4053
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2005 Redistributable (x64)
Microsoft Visual C++ 2008 ATL Update kb973924 - x64 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x64 9.0.21022
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.17
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161
Microsoft Visual C++ 2010  x64 Redistributable - 10.0.30319
Microsoft Visual C++ 2010  x86 Redistributable - 10.0.30319
Microsoft Visual Studio Tools for Applications 2.0 - ENU
Microsoft Visual Studio Tools for Applications 2.0 Runtime
Mozilla Firefox (3.6.11)
MSVCRT
MSVCRT_amd64
MuseScore 1.0 MuseScore score typesetter
MySQL Connector/ODBC 5.1
MySQL Workbench 5.2 CE
Norton Online Backup
Nuance RealSpeak Solo Dutch-Netherlands
NVDA 2010.2
OpenOffice.org 3.2
OpenProj
PDF Complete Special Edition
Privacy Manager for HP ProtectTools
QuarkXPress 6.1
QuickTime
RDPSoftware Core Components 1.0
Realtek PC Camera
RICOH Media Driver
Roxio Activation Module
Roxio Creator Audio
Roxio Creator Business
Roxio Creator Business v10
Roxio Creator Copy
Roxio Creator Data
Roxio Creator Tools
Roxio Express Labeler 3
Roxio MyDVD
sceye 5th
SIW version 2011.10.29
Sonic CinePlayer Decoder Pack
SQL Server 2008 R2 Common Files
SQL Server 2008 R2 Database Engine Services
SQL Server 2008 R2 Database Engine Shared
Sql Server Customer Experience Improvement Program
Synaptics Pointing Device Driver
TeamViewer 6
TeamViewer 7
Theft Recovery
tools-windows
TrueCrypt
Validity Fingerprint Driver
VD64Inst
ViceVersa FREE 1.0.3
Visual Basic for Applications (R) Core
Visual Basic for Applications (R) Core - Dutch
Visual Basic for Applications (R) Core - English
Visual Studio 2008 x64 Redistributables
Visual Studio C++ 10.0 Runtime
Visual Studio C++ 9.0 Runtime
VmciSockets
VMware Player
VMX Builder 0.9
WD Diagnostics
Window-Eyes 7.5.1.0
Windows-stuurprogrammapakket - SilverCreations AG sceye-7736 (12/10/2009 3.4.1.20)
Windows-stuurprogrammapakket - SilverCreations AG sceye-7737 (12/10/2009 3.4.1.20)
Windows-stuurprogrammapakket - SilverCreations AG sceye-7738 (12/10/2009 3.4.1.20)
Windows-stuurprogrammapakket - SilverCreations AG sceye-7750 (12/10/2009 3.4.1.20)
Windows 7 Default Setting
Windows Driver Package - Broadcom Bluetooth  (07/30/2009 6.2.0.9405)
Windows Driver Package - Broadcom Bluetooth  (12/16/2009 6.2.0.9414)
Windows Driver Package - Broadcom HIDClass  (07/28/2009 6.2.0.9800)
Windows Live Communications Platform
Windows Live Essentials
Windows Live Family Safety
Windows Live ID Sign-in Assistant
Windows Live Installer
Windows Live Language Selector
Windows Live Mail
Windows Live Mesh
Windows Live Mesh - ActiveX-besturingselement voor externe verbindingen
Windows Live Messenger
Windows Live Messenger Companion Core
Windows Live MIME IFilter
Windows Live Movie Maker
Windows Live Photo Common
Windows Live Photo Gallery
Windows Live PIMT Platform
Windows Live Remote Client
Windows Live Remote Client Resources
Windows Live Remote Service
Windows Live Remote Service Resources
Windows Live SOXE
Windows Live SOXE Definitions
Windows Live UX Platform
Windows Live UX Platform Language Pack
Windows Live Writer
Windows Live Writer Resources
Windows Media Player Firefox Plugin
Windows Mobile Apparaatcentrum
WinZip 14.0

The problem is, the list is still to much widespread. Is it possible to filter more? An idea could be to group every line that consists of the 2 same words on 1 line. Like group everything of Windows Live to 1 thing.

Like:
Quote
Windows Live Communications Platform
Windows Live Essentials
Windows Live Family Safety
Windows Live ID Sign-in Assistant
Windows Live Installer
etc


To:
Quote
Windows Live Communication Platforms | Essentials | Family Safety | etc

Tnx for your help.
Title: Re: Batch file to export a .txt of the Add/Remove Programs list in Windows
Post by: hdas202 on June 03, 2013, 08:52:36 AM
Why to export to text file. Export it to csv, you can even open that in Excel.

You can read this article to know how to export all installed apps

http://www.funbutlearn.com/2013/06/easily-export-all-installed-apps-from.html