JSI Tip 9320. How can I generate a report of the software installed on a remote computer?


I have scripted RMTSoftware.bat to display the software installed on a remote computer.

The syntax for using RMTSoftware.bat is:

RMTSoftware Computer1 \[Computer2 ... ComputerN\]

Where ComputerX is the NetBIOS computer name of a remote Windows NT-based computer.

The output is displayed on the console is the following .CSV format, but you can redirect it to a file:

"Computer Name","Application DisplayName","Application \uninstall sub-key"
NOTE: RMTSoftware.bat uses REG.EXE, built into Windows XP (NT 5.1) and later, or installed on Windows 2000 from the Support Tools on the operating system CD-ROM.

RMTSoftware.bat contains:

@echo off
if \{%1\}

\{\} @echo Syntax: RMTSoftware Computer1 \[Computer2 ... ComputerN\]&goto :EOF setlocal ENABLEDELAYEDEXPANSION set wrk=%TEMP%\RMTSoftware_%RANDOM% set wrk1="%wrk%.TM1" set wrk2="%wrk%.TM2" If exist %wrk1% del /q %wrk1% If exist %wrk2% del /q %wrk2% set key=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall /s :Loop if \{%1\}

\{\} endlocal&goto :EOF for /f "Tokens=*" %%a in ('reg query \\%1\%key%^|findstr /I /L "HKEY_LOCAL_MACHINE\Software DisplayName"') do ( set line=%%a if /i "!line:~0,27!" EQU "HKEY_LOCAL_MACHINE\Software" set subkey=!line:~71! if /i "!line:~0,11!" EQU "DisplayName" set line=!line:,=;!&@echo "%1","!line:~19!","!subkey!">>%wrk1% ) shift sort %wrk1% /O %wrk2% del /q %wrk1% type %wrk2% del /q %wrk2% goto :Loop



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish