|
Why would you ever need to do this you ask? Well if you have over
20 computers on a domain, and the BSA (Business Software Alliance)
is knocking at your door with threats of lawsuits, you better check
your computers on the network quickly so that you can bring your
systems to legal status
The following batch file will create a list of all software included
in the control panel Add/Remove Programs and generate a .csv file
which can be imported directly into your favorite spreadsheet program.
Simply copy and paste the below script into a text file called
Intalled.bat and use the following command to run:
Installed Folder_Path
Folder_Path can be any local folder or network share. The .CSV
file will be called ComputerName.CSV
--------- COPY SCRIPT BELOW -----------
@echo off
setlocal
if {%1}=={} goto Syntax
if not exist %1\*.* goto Syntax
set folder=%1
set folder=%folder:"=%
set /a cntrpt=0
if exist "%folder%\%computername%.csv" del /q "%folder%\%computername%.csv"
regedit /a "%temp%\Installed.reg" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
for /f "Skip=4 Tokens=1,2,7 Delims=\]=" %%a in ('type
"%temp%\Installed.reg"') do set p1=%%a&set p2=%%b&set
p3=%%c&call :report
if defined app set app="%app:"=%"
if defined app set app=%app:[=%
if not defined app set app="%key%"
if defined key set /a cntrpt=%cntrpt% + 1&@echo "%key%",%app%>>"%folder%\%computername%.csv"
if exist "%temp%\Installed.reg" del /q "%temp%\Installed.reg"
@echo %computername% has %cntrpt% report lines.
endlocal
goto :EOF
:Syntax
@echo Syntax: Installed ReportFolder
endlocal
goto :EOF
:report
set p1=%p1:"=%
if "%p1:~0,1%" EQU "[" goto new
if /i "%p1%" EQU "DisplayName" set app=%p2%
goto :EOF
:new
if defined app set app="%app:"=%"
if defined app set app=%app:[=%
if not defined app set app="%key%"
if defined key set /a cntrpt=%cntrpt% + 1&@echo "%key%",%app%>>"%folder%\%computername%.csv"
set app=
set key=%p3%
|