#117689 - 2004-04-12 02:45 PM
Re: My Computer Info - for Help Desk use PART 3
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Doc,
It looks like this does not get any info about the version of Office programs that I have installed. I am running office 2000.
If I do the following, I should be able to get the specifics
Code:
$apppaths='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\'
$wordver=GETFILEVERSION(READVALUE($apppaths+'\winword.exe',''))
Maybe add in detection for TrendMicro, Avast, Sophos, AVG AV products. I know Symantec and McAfee are the most common.
Kent
|
Top
|
|
|
|
#117690 - 2004-04-12 06:51 PM
Re: My Computer Info - for Help Desk use PART 3
|
jpg35
Fresh Scripter
Registered: 2003-08-06
Posts: 27
Loc: SoCal
|
Script is not picking up my Mcafee, otherwise this script is very cool man. Good work.
|
Top
|
|
|
|
#117691 - 2004-04-12 09:36 PM
Re: My Computer Info - for Help Desk use PART 3
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Okay I've updated the code and posted an update. Make sure you flush your cache before attempting to download again.
The file header with the updated version should say
; ********** REVISION HISTORY ******************
; 001.03 *** 4/12/2004 11:38AM - By NTDOC
Kent,
I'm pulling back office versions from 97/2000/2002/2003 so far without a problem in our environment.
This code is processing the UNINSTALL keys and the APP PATH keys both. Then attempts to remove duplicates from the list of UNINSTALL if already found in APP PATH.
Found an issue with some EXE files that the BinFileVersion would comeback as 0.0.0.0 so I modified the code to show FileVersion for those cases.
I've also updated the code to show McAfee or None Detected.
Sorry, but I probably will not be adding other AV detection into this script, at least at this time.
Les said that the McAfee did not show for his 7.1 ePO version. I don't have any McAfee AV so can't test. If anyone can test and confirm and/or provide the proper code for McAfee both older and newer versions I'll be glad to update the code with it.
ps. I also corrected a typo that Les alerted me to.
Edited by NTDOC (2004-04-12 09:37 PM)
|
Top
|
|
|
|
#117692 - 2004-04-12 10:15 PM
Re: My Computer Info - for Help Desk use PART 3
|
jpg35
Fresh Scripter
Registered: 2003-08-06
Posts: 27
Loc: SoCal
|
Got the mcafee part working. What's in red is the changes i've made. Thanks again for the code.
Code:
Select Case $McAfeeInfo [0]<>"" $WL = $WL +'<p><b><font size="5" color="#800000">ANTIVIRUS INFORMATION</font></b></p>'+@CRLF +'<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">'+@CRLF +' <tr>'+@CRLF +' <td width="20%"><b>ANTIVIRUS PRODUCT VERSION</b></td>'+@CRLF +' <td width="20%">'+$McAfeeInfo [0]+'</td>'+@CRLF +' <td width="20%"><b>DAT VERSION</b></td>'+@CRLF +' <td width="20%">'+$McAfeeInfo [1]+'</td>'+@CRLF +' </tr>'+@CRLF +' <tr>'+@CRLF +' <td width="20%"><b>ENGINE VERSION</b></td>'+@CRLF +' <td width="20%">'+$McAfeeInfo [2]+'</td>'+@CRLF +' <td width="20%"><b></b></td>'+@CRLF +' <td width="20%"></td>'+@CRLF +' </tr>'+@CRLF +'</table>'+@CRLF
|
Top
|
|
|
|
#117695 - 2004-04-16 10:47 AM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
Question moved from URL: http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=&Number=116337
What I like to know, is:
What is this code doing?
For Each $Key in $App2
$DisplayName = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayName')
$DisplayVersion = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayVersion')
$DisplayName = IIF(InStr($SoftInfo,$DisplayName),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'ACDSee'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Acrobat 6.0'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Illustrator'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Photoshop 5.5'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Photoshop 6.0'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Photoshop 7.0'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Adobe Reader'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Alcohol 120'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Dreamweaver MX'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Fireworks MX'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Flash MX'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'FreeHand MX'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'LiveReg'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'LiveUpdate'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'MSN Messenger'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Macromedia FreeHand'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Microsoft Office FrontPage'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Microsoft Outlook'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Net2Phone'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'RoboHelp Office'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'SnagIt'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Symantec AntiVirus'),'',$DisplayName)
$DisplayName = IIF(InStr($DisplayName,'Windows Media Encoder'),'',$DisplayName)
Some records from $HKLMAppPaths2 = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
don't show up in the output. Trying to find out why.
I tried to add lines to it, but nothing seems to change.
Any explanation?
Tim
Edited by thoek (2004-04-16 10:50 AM)
|
Top
|
|
|
|
#117697 - 2004-04-16 10:45 PM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
ok.. that explains a lot..
Some suggestions?
what happens now, is that it only shows applications that have a version number.
When I look at my own network, I see a lot of machines that have software installed, that doesn't contain a version number. Especially the once linked only in the UNINSTALL Paths
I edited the script a little to show some more applications.
Code:
For Each $Key In $App2
$DisplayName = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayName')
$DisplayVersion = ReadValue($HKLMAppPaths2 + "\" + $Key,'DisplayVersion')
$Publisher = ReadValue($HKLMAppPaths2 + "\" + $Key,'Publisher')
*<Cut>*
If Len($DisplayName)
If Len($DisplayVersion)
If Len($Publisher)
$SoftInfo = $SoftInfo + Trim($DisplayName) + Chr(42) + Trim($Key) + Chr(42) + Trim($DisplayVersion) + Chr(42) + Trim($Publisher) + @CRLF
Else
$Publisher = "N/A"
$SoftInfo = $SoftInfo + Trim($DisplayName) + Chr(42) + Trim($Key) + Chr(42) + Trim($DisplayVersion) + Chr(42) + $Publisher + @CRLF
EndIf
Else
$DisplayVersion = "N/A"
If Len($Publisher)
$SoftInfo = $SoftInfo + Trim($DisplayName) + Chr(42) + Trim($Key) + Chr(42) + $DisplayVersion + Chr(42) + Trim($Publisher) + @CRLF
Else
$Publisher = "N/A"
$SoftInfo = $SoftInfo + Trim($DisplayName) + Chr(42) + Trim($Key) + Chr(42) + $DisplayVersion + Chr(42) + $Publisher + @CRLF
EndIf
EndIf
Not very nice but it does the trick.
At the lines I now add 'N/A' I want to add publishernames, by checking up on the program name, and changing this to the real value. Something I have to lookup once, and manually add it to the script, for the ones that don't show this Publisher
Like this:
If program=Nero { Publisher = Ahead }
etc.
Some results:
IBM ThinkPad - {B5599ECB-DA72-43EE-8A30-2C80396FF8BB}
AcDSee PowerPack 5 - {5058B085-AA79-41E5-A726-681B4C4B846E}
http://www.dutchhits.com/forumimages/output.bmp
Sorry for the big images.
These keys are returned as InstallPaths. Why are these returned, and would it be possible to gather data for these keys from another location
Most of these records are great to have in my opinion. But this is just a test for me, to see if this could be usefull on our network.
What I do miss, is an option to exclude programs/strings totally from this list.
In my list some programs now show up, and the only way to retrieve info on those, is too look at the compiledate of the program. (ie. modified date).
Version numbers can be equal, even if there are a lot of changes made. something we decided to do in the past, since some programs are changed very often (even more times a week) Although automated, it sometimes fails, and then problems in the program can occur.
That would be usefull for me, since we use a lot of small programs, that change in version weekly/monthly, and we're still not able to have that configured automatically ('failureless') on our networks.
I already have a seperate script that verifies those programs aside, and uninstall/reinstalls the current active version.
Edited by thoek (2004-04-16 10:46 PM)
|
Top
|
|
|
|
#117698 - 2004-04-17 01:15 PM
Re: My Computer Info - for Help Desk use PART 3
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Thanks for the feedback thoek
I'll try to implement the PUBLISHER idea this weekend if I get time.
As for the other ideas or issues with versions and exclusions switches I'm sorry, but I wrote this as an general information gathering tool, not as a decision making script. If you have specific requirements to know when to update a file or group of files I would not use this script, I'd specifically target those files.
p.s. I've updated the script to include PROCESSES, SERVICES, HARD DRIVES, and STARTUP ITEMS.
Remember to clear your cache or at least the MyComputerInfo.zip from your cache before downloading again.
; 001.09 *** 04/17/2004 3:00AM - By NTDOC ; ********** Added support for Hard drives and Startup Items ; 001.08 *** 04/17/2004 2:25AM - By NTDOC ; ********** Added support for listing Services and their states
MyComputerInfo download http://www.kixhelp.com/Downloads/MyComputerInfo.zip
|
Top
|
|
|
|
#117700 - 2004-04-19 10:31 AM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
Thanx. Works fine for me..
Maybe change this section from:
Code:
For Each $Key In $App1
$Path = ReadValue($HKLMAppPaths1 + "\" + $Key,"")
If Len($Path)
If InStr($Path,'%') $Path = ExpandEnvironmentVars($Path) EndIf
If InStr($Path,'"') $Path=Split($Path,'"')[1] EndIf
$Path = IIf(InStr($Key,'WRITE.EXE'),'',$Path)
$Path = IIf(InStr($Key,'winzip.exe'),'',$Path)
If Trim(GetFileVersion($Path,'FileDescription')) <> ""
If Trim(GetFileVersion($Path,'BinFileVersion'))='0.0.0.0'
$FileVer = 'FileVersion'
Else
$FileVer = 'BinFileVersion'
EndIf
$SoftInfo = $SoftInfo + Trim(GetFileVersion($Path,'FileDescription')) + Chr(42)
+ $Path + Chr(42) + Trim(GetFileVersion($Path,$FileVer)) + @CRLF
EndIf
EndIf
Next
to
Code:
For Each $Key In $App1
$Path = ReadValue($HKLMAppPaths1 + "\" + $Key,"")
If Len($Path)
If InStr($Path,'%') $Path = ExpandEnvironmentVars($Path) EndIf
If InStr($Path,'"') $Path=Split($Path,'"')[1] EndIf
$Path = IIf(InStr($Key,'WRITE.EXE'),'',$Path)
$Path = IIf(InStr($Key,'winzip.exe'),'',$Path)
If Trim(GetFileVersion($Path,'FileDescription')) <> ""
If Trim(GetFileVersion($Path,'BinFileVersion'))='0.0.0.0'
$FileVer = 'FileVersion'
Else
$FileVer = 'BinFileVersion'
EndIf
$SoftInfo = $SoftInfo + Trim(GetFileVersion($Path,'FileDescription')) + Chr(42) + $Path + Chr(42) + Trim(GetFileVersion($Path,$FileVer))
+ Chr(42) + Trim(GetFileVersion($Path,'CompanyName')) + @CRLF
EndIf
EndIf
Next
This to retrieve Publisher data for the $HKLMAppPaths1.
Any ideas on the timing of this script?
I mean: what are other users experiences on how long it takes for this script to complete?
It varies a lot on our PCs.
From only 10 seconds, up to 45, or even more on antique machines.
I'm a number freak. Allways want to know how long something runs/executes, and in these cases even create graphical views of it from data daily stored in a db
Maybe this RunningTime() ( http://www.kixtart.org/ubbthreads/showflat.php?Number=81817 ) is an option to include in future version, and show the execution time on top of the results-page.
Easy way to see if there are slower machines on the network, or machines that might need some extra attention
Edited by T_Hoek (2004-04-19 02:40 PM)
|
Top
|
|
|
|
#117703 - 2004-04-20 07:56 PM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
Sorry, my mistake also. Forgot to add the corresponding code.. Thanx for adding
|
Top
|
|
|
|
#117704 - 2004-04-25 06:32 PM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
Another idea for you which I'm trying to work out right now. Again for the software inventory. I'm adding a timestamp to the registry together with the software-name (HKLM/software/Scriptlogic/LastInventory for example). At this location I'm adding a line for each package with the corresponding inventory date. Like: Code:
$swcheck=updateregistry('$HKLMss','$SoftwareName','$TimeNow','REG_SZ')
What I like to see is newly installed software, next to the full list. Could be newly installed servicepacks, or any other software package.
I'm currently having some problems with comparing the two arrays. - array with software from your script. - array with all software added to the registry, after a previous run. And updating/deleting where possible
I'll try to add some code soon, if I get any further with it.
|
Top
|
|
|
|
#117706 - 2004-04-26 09:14 AM
Re: My Computer Info - for Help Desk use PART 3
|
Trackz
Fresh Scripter
Registered: 2004-03-18
Posts: 37
Loc: Rotterdam, The Netherlands
|
Thanx for pointing that out. I think it would be sufficient enough to only add a name, and versionnumber to the registry, and verify gathered data with this registry list, So this wouldn't reach the limits
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 366 anonymous users online.
|
|
|