bsharath
asked on
Scan the network for a software
Hi,
I need to find who all have MSN messenger installed in there machine.can we find only 1 particular software.I have softwares which will take the whole machine inventory.But i need to search for a particular software on all machines in the domain/Network.
THX
Sharath
I need to find who all have MSN messenger installed in there machine.can we find only 1 particular software.I have softwares which will take the whole machine inventory.But i need to search for a particular software on all machines in the domain/Network.
THX
Sharath
ASKER
I get this
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Software scan.vbs
Line: 15
Char: 56
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
-------------------------- -
OK
-------------------------- -
I have created a file called computers.txt and a machine name in it.
--------------------------
Windows Script Host
--------------------------
Script: C:\Software scan.vbs
Line: 15
Char: 56
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
I have created a file called computers.txt and a machine name in it.
My mistake...
Const HKLM = &H80000002
Dim objFSO:Set objFSO=CreateObject("Scrip ting.FileS ystemObjec t")
Dim objOutput:Set objOutput=objFSO.CreateTex tFile("C:\ MSNMsgInst allations. txt")
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT extFile(st rFile).Rea dAll, vbNewLine)
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv" )
strKeyPath = "Software\Microsoft\MSNMes senger"
strValueName = "InstallationDirectory"
objRegistry.GetStringValue HKLM, strKeyPath, strValueName, strData
If IsNull(strData) Then
objOutput.WriteLine "MSN is not installed on " & PC
Else
objOutput.WriteLine "MSN is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
Const HKLM = &H80000002
Dim objFSO:Set objFSO=CreateObject("Scrip
Dim objOutput:Set objOutput=objFSO.CreateTex
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv"
strKeyPath = "Software\Microsoft\MSNMes
strValueName = "InstallationDirectory"
objRegistry.GetStringValue
If IsNull(strData) Then
objOutput.WriteLine "MSN is not installed on " & PC
Else
objOutput.WriteLine "MSN is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
ASKER
It says not found.
Can you give me the same thing for yahoo
Can you give me the same thing for yahoo
ASKER
What are the changes we need to make for different softwares.
Const HKLM = &H80000002
Dim objFSO:Set objFSO=CreateObject("Scrip ting.FileS ystemObjec t")
Dim objOutput:Set objOutput=objFSO.CreateTex tFile("C:\ MSNMsgInst allations. txt")
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT extFile(st rFile).Rea dAll, vbNewLine)
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv" )
strKeyPath = "Software\Yahoo\Essentials "
strValueName = "MainDir"
objRegistry.GetStringValue HKLM, strKeyPath, strValueName, strData
If IsNull(strData) Then
objOutput.WriteLine "MSN is not installed on " & PC
Else
objOutput.WriteLine "MSN is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
Admin Edit
Dim objFSO:Set objFSO=CreateObject("Scrip
Dim objOutput:Set objOutput=objFSO.CreateTex
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv"
strKeyPath = "Software\Yahoo\Essentials
strValueName = "MainDir"
objRegistry.GetStringValue
If IsNull(strData) Then
objOutput.WriteLine "MSN is not installed on " & PC
Else
objOutput.WriteLine "MSN is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
Admin Edit
ASKER
It says
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Software scan.vbs
Line: 23
Char: 1
Error: Type mismatch: 'Admin'
Code: 800A000D
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Software scan.vbs
Line: 23
Char: 1
Error: Type mismatch: 'Admin'
Code: 800A000D
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
My mistake...use this:
Const HKLM = &H80000002
Dim objFSO:Set objFSO=CreateObject("Scrip ting.FileS ystemObjec t")
Dim objOutput:Set objOutput=objFSO.CreateTex tFile("C:\ MSNMsgInst allations. txt")
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT extFile(st rFile).Rea dAll, vbNewLine)
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv" )
strKeyPath = "Software\Yahoo\Essentials "
strValueName = "MainDir"
objRegistry.GetStringValue HKLM, strKeyPath, strValueName, strData
If IsNull(strData) Then
objOutput.WriteLine "YIM is not installed on " & PC
Else
objOutput.WriteLine "YIM is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
As for what to test, you'll need to know the reg path - I just happen to have those two installed, so it was easy to locate...
Mainly this is the path to the data:
strKeyPath = "Software\Yahoo\Essentials "
and this is the value you're looking for...could be different for different products...
strValueName = "MainDir"
Const HKLM = &H80000002
Dim objFSO:Set objFSO=CreateObject("Scrip
Dim objOutput:Set objOutput=objFSO.CreateTex
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv"
strKeyPath = "Software\Yahoo\Essentials
strValueName = "MainDir"
objRegistry.GetStringValue
If IsNull(strData) Then
objOutput.WriteLine "YIM is not installed on " & PC
Else
objOutput.WriteLine "YIM is installed on " & PC & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing
As for what to test, you'll need to know the reg path - I just happen to have those two installed, so it was easy to locate...
Mainly this is the path to the data:
strKeyPath = "Software\Yahoo\Essentials
and this is the value you're looking for...could be different for different products...
strValueName = "MainDir"
ASKER
I have yahoo installed in my computer but it says not found.For msn this worked.
Hmm - could be that it's a different version.
What does this return?
Click Start->Run->Cmd /c reg query hklm\software\yahoo > c:\yahoo.txt && start c:\yahoo.txt
What does this return?
Click Start->Run->Cmd /c reg query hklm\software\yahoo > c:\yahoo.txt && start c:\yahoo.txt
ASKER
HKEY_LOCAL_MACHINE\softwar
HKEY_LOCAL_MACHINE\softwar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks...
Very glad to help you - as always! :^)
Dim objFSO:Set objFSO=CreateObject("Scrip
Dim objOutput:Set objOutput=objFSO.CreateTex
strFile="C:\Computers.txt"
arrData=Split(objFSO.OpenT
For Each PC in arrData
Set objRegistry = GetObject ("winmgmts:\\" & PC & "\root\default:StdRegProv"
strKeyPath = "Software\Microsoft\MSNMes
strValueName = "InstallationDirectory"
objRegistry.GetStringValue
If IsNull(strData) Then
objOutput.WriteLine "MSN is not installed on " & PC
Else
objOutput.WriteLine "MSN is installed on " & PC " & " in " & strData
End If
Set objRegistry=Nothing
Next
objOutput.Close
wscript.echo "Process completed."
Set objOutput=Nothing
Set objFSO=Nothing