bsharath
asked on
Get the add/remove programs softwares to a file.
Hi,
How can i get a remote machines softwares to a file.All the software names to a file.
Regards
Sharath
How can i get a remote machines softwares to a file.All the software names to a file.
Regards
Sharath
get hijackthis >> http://www.download.com/HijackThis/3000-8022_4-10379544.html
run it, click on Open the Mics Tools Section
click on Open Uninstall Manager
then click on Save List
save the file as text file
run it, click on Open the Mics Tools Section
click on Open Uninstall Manager
then click on Save List
save the file as text file
ASKER
Any script to retrieve this one on many computers.
Returns a list of all software installed on a computer, whether or not by Windows Installer. This script reads installed applications from the registry.
You will need to make changes as per your Enviorment :
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Window s\CurrentV ersion\Uni nstall\"
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "InstallDate"
strEntry3 = "VersionMajor"
strEntry4 = "VersionMinor"
strEntry5 = "EstimatedSize"
Set objReg = GetObject("winmgmts://" & strComputer & _
"/root/default:StdRegProv" )
objReg.EnumKey HKLM, strKey, arrSubkeys
WScript.Echo "Installed Applications" & VbCrLf
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM , strKey & strSubkey, _
strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
If strValue1 <> "" Then
WScript.Echo VbCrLf & "Display Name: " & strValue1
End If
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry2, strValue2
If strValue2 <> "" Then
WScript.Echo "Install Date: " & strValue2
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry4, intValue4
If intValue3 <> "" Then
WScript.Echo "Version: " & intValue3 & "." & intValue4
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry5, intValue5
If intValue5 <> "" Then
WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes"
End If
Next
You will need to make changes as per your Enviorment :
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strComputer = "."
strKey = "SOFTWARE\Microsoft\Window
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "InstallDate"
strEntry3 = "VersionMajor"
strEntry4 = "VersionMinor"
strEntry5 = "EstimatedSize"
Set objReg = GetObject("winmgmts://" & strComputer & _
"/root/default:StdRegProv"
objReg.EnumKey HKLM, strKey, arrSubkeys
WScript.Echo "Installed Applications" & VbCrLf
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM
strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
If strValue1 <> "" Then
WScript.Echo VbCrLf & "Display Name: " & strValue1
End If
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry2, strValue2
If strValue2 <> "" Then
WScript.Echo "Install Date: " & strValue2
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry4, intValue4
If intValue3 <> "" Then
WScript.Echo "Version: " & intValue3 & "." & intValue4
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry5, intValue5
If intValue5 <> "" Then
WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes"
End If
Next
ASKER
ajay_walia
This works on a single machine.How do i run this script on many machines.Which creates different files for each machine.
This works on a single machine.How do i run this script on many machines.Which creates different files for each machine.
If you have all the Computer names in a text file you can make Use of the link below to change the script mentioned above to run it against multiple computers
http://www.microsoft.com/technet/scriptcenter/resources/tales/sg1102.mspx
Or you can make Use of an template
http://www.microsoft.com/technet/scriptcenter/scripts/templates/default.mspx?mfr=true
This would also make help you out
http://www.tek-tips.com/faqs.cfm?fid=4871
http://www.microsoft.com/technet/scriptcenter/resources/tales/sg1102.mspx
Or you can make Use of an template
http://www.microsoft.com/technet/scriptcenter/scripts/templates/default.mspx?mfr=true
This would also make help you out
http://www.tek-tips.com/faqs.cfm?fid=4871
Hi Sharath
Create a folder in c called results. Different files for each machine will be created in here. Then create the following batch file
@echo off
for /f %%x in (c:\computers.txt) do (
reg query \\%%x\HKLM\software\micros oft\window s\currentv ersion\uni nstall >>c:\results\1%%x.txt
for /f "delims=," %%y in (c:\results\1%%x.txt) do reg query "\\%%x\%%y" /v DisplayName >>c:\results\%%x.txt
)
del c:\results\1*.txt /q
Regards
Create a folder in c called results. Different files for each machine will be created in here. Then create the following batch file
@echo off
for /f %%x in (c:\computers.txt) do (
reg query \\%%x\HKLM\software\micros
for /f "delims=," %%y in (c:\results\1%%x.txt) do reg query "\\%%x\%%y" /v DisplayName >>c:\results\%%x.txt
)
del c:\results\1*.txt /q
Regards
ASKER
I get this.
C:\>"Get all softwares installed.bat"
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-mrd10 0.txt.
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-nas01 .txt.
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-srv10 .txt.
The system cannot find the file specified.
C:\>"Get all softwares installed.bat"
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-mrd10
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-nas01
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-srv10
The system cannot find the file specified.
I tried in my computer and it worked. Can you please remove @echo off and send the output?
ASKER
I get this.
C:\>"Get all softwares installed.bat"
C:\>for /F %x in (c:\computers.txt) do (
reg query \\%x\HKLM\software\microso ft\windows \currentve rsion\unin stall 1>>c:\r
esults\1%x.txt
for /F "delims=," %y in (c:\results\1%x.txt) do reg query "\\%x\%y" /v DisplayN
ame 1>>c:\results\%x.txt
)
C:\>(
reg query \\dev-chen-mrd100\HKLM\sof tware\micr osoft\wind ows\curren tversion\u nins
tall 1>>c:\results\1dev-chen-mr d100.txt
for /F "delims=," %y in (c:\results\1dev-chen-mrd1 00.txt) do reg query "\\dev-c
hen-mrd100\%y" /v DisplayName 1>>c:\results\dev-chen-mrd 100.txt
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-mrd10 0.txt.
C:\>(
reg query \\dev-chen-nas01\HKLM\soft ware\micro soft\windo ws\current version\un inst
all 1>>c:\results\1dev-chen-na s01.txt
for /F "delims=," %y in (c:\results\1dev-chen-nas0 1.txt) do reg query "\\dev-ch
en-nas01\%y" /v DisplayName 1>>c:\results\dev-chen-nas 01.txt
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-nas01 .txt.
C:\>(
reg query \\dev-chen-srv10\HKLM\soft ware\micro soft\windo ws\current version\un inst
all 1>>c:\results\1dev-chen-sr v10.txt
for /F "delims=," %y in (c:\results\1dev-chen-srv1 0.txt) do reg query "\\dev-ch
en-srv10\%y" /v DisplayName 1>>c:\results\dev-chen-srv 10.txt
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-srv10 .txt.
C:\>del c:\results\1*.txt /q
The system cannot find the file specified.
C:\>
C:\>"Get all softwares installed.bat"
C:\>for /F %x in (c:\computers.txt) do (
reg query \\%x\HKLM\software\microso
esults\1%x.txt
for /F "delims=," %y in (c:\results\1%x.txt) do reg query "\\%x\%y" /v DisplayN
ame 1>>c:\results\%x.txt
)
C:\>(
reg query \\dev-chen-mrd100\HKLM\sof
tall 1>>c:\results\1dev-chen-mr
for /F "delims=," %y in (c:\results\1dev-chen-mrd1
hen-mrd100\%y" /v DisplayName 1>>c:\results\dev-chen-mrd
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-mrd10
C:\>(
reg query \\dev-chen-nas01\HKLM\soft
all 1>>c:\results\1dev-chen-na
for /F "delims=," %y in (c:\results\1dev-chen-nas0
en-nas01\%y" /v DisplayName 1>>c:\results\dev-chen-nas
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-nas01
C:\>(
reg query \\dev-chen-srv10\HKLM\soft
all 1>>c:\results\1dev-chen-sr
for /F "delims=," %y in (c:\results\1dev-chen-srv1
en-srv10\%y" /v DisplayName 1>>c:\results\dev-chen-srv
)
The system cannot find the path specified.
The system cannot find the file c:\results\1dev-chen-srv10
C:\>del c:\results\1*.txt /q
The system cannot find the file specified.
C:\>
Hi Sharath
%y should be %%y
Regards
%y should be %%y
Regards
ASKER
This is the script i am using.
for /f %%x in (c:\computers.txt) do (
reg query \\%%x\HKLM\software\micros oft\window s\currentv ersion\uni nstall >>c:\results\1%%x.txt
for /f "delims=," %%y in (c:\results\1%%x.txt) do reg query "\\%%x\%%y" /v DisplayName >>c:\results\%%x.txt
)
del c:\results\1*.txt /q
for /f %%x in (c:\computers.txt) do (
reg query \\%%x\HKLM\software\micros
for /f "delims=," %%y in (c:\results\1%%x.txt) do reg query "\\%%x\%%y" /v DisplayName >>c:\results\%%x.txt
)
del c:\results\1*.txt /q
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get something like this.
I had to create the folder (results)
HKEY_LOCAL_MACHINE\softwar e\microsof t\windows\ currentver sion\unins tall\4t Tray Minimizer_is1
DisplayName REG_SZ 4t Tray Minimizer Free 4.40
HKEY_LOCAL_MACHINE\softwar e\microsof t\windows\ currentver sion\unins tall\ADSea rch
DisplayName REG_SZ ADSearch
HKEY_LOCAL_MACHINE\softwar e\microsof t\windows\ currentver sion\unins tall\Advan ced Office Password Recovery
DisplayName REG_SZ Advanced Office Password Recovery (remove only)
Any way to just get the software names?
I had to create the folder (results)
HKEY_LOCAL_MACHINE\softwar
DisplayName REG_SZ 4t Tray Minimizer Free 4.40
HKEY_LOCAL_MACHINE\softwar
DisplayName REG_SZ ADSearch
HKEY_LOCAL_MACHINE\softwar
DisplayName REG_SZ Advanced Office Password Recovery (remove only)
Any way to just get the software names?
They are the software names :) This is the least detailed output, normally the output is more complex and contains all keys. The text next to DisplayName REG_SZ is what you need like
DisplayName REG_SZ 4t Tray Minimizer Free 4.40
Regards
DisplayName REG_SZ 4t Tray Minimizer Free 4.40
Regards
A little trick. In the notepad window, click edit, then replace. Type HKEY_LOCAL_MACHINE\softwar e\microsof t\windows\ currentver sion\unins tall\ to find what line and leave empty the replace with line. Then click replace all ;)
Hope this helps!