#69990 - 2002-09-19 05:25 AM
My Computer Info - for Help Desk use
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
This script may be able to help your Helpdesk or Desktop support Analysts by allowing the user to run the script and retrieve back common information needed by support personnel.
{edit}Okay Badboii I modified the code to include a "modified" version of Howard's GetIPinfo UDF. I also add CPU & Speed, as well as a low disk space warning. Have not tested this on Windows 9x though.
code:
; *** File Name: MYCOMP.KIX *** v1.2 ; *** Date Created: 2002-03-05 by Ron Lewis ; *** Last Date Modified: 2002-09-21 13:10 PST - By Ron Lewis ; *** CHANGE: Updated for use with GetIPinfo UDF, added CPU & Speed, and Low disk space warning. ; *** Comments: This file is called by a shortcut on the users desktop. ; *** Acknowledgments: Thanks to the following for help and ideas ; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock
BREAK On $IPaddr = EnumIPinfo(0,0) if $IPaddr = "0.0.0.0" or $IPaddr = "" $IPinfo = GetIPinfo() $IPaddr = $IPinfo[0] $SNmask = $IPinfo[1] $Gateway = $IPinfo[2] else $SNmask = EnumIPinfo(0,1) $Gateway = EnumIPinfo(0,3) endif
$nul = SETCONSOLE("hide") $HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" ; CheckIE variables DIM $RC1, $RC2, $RC3, $TmpLen1, $TmpLen2, $TmpLen3 DIM $IEBuild, $IEFullVer, $IEMajor, $IEMinor, $IESubBd, $IEVer, $IECustom, $IEName
While @error = 0 $app = enumkey("$HKLMAppPaths\",$index) $index = $index + 1 Select case $app = "excel.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Excelver = getfileversion("$path\$app","Productversion") case $app = "winword.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Wordver = getfileversion("$path\$app","Productversion") case $app = "powerpnt.exe" $path = readvalue("$HKLMAppPaths\$app","path") $PowerPointver = getfileversion("$path\$app","Productversion") case $app = "msaccess.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Accessver = getfileversion("$path\$app","Productversion") case $app = "mspub.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Publisherver = getfileversion("$path\$app","Productversion") case $app = "winproj.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Projectver = getfileversion("$path\$app","Productversion") case $app = "visio32.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Visiover = getfileversion("$path\$app","Productversion") case $app = "outlook.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Outlookver = getfileversion("$path\$app","Productversion") endselect loop
$Ex=$Excelver $Wo=$Wordver $Po=$PowerPointver $Ac=$Accessver $Pu=$Publisherver $Pr=$Projectver $Vi=$Visiover $Ou=$Outlookver
GoSub "CheckIE"
$DiskSpace = GetDiskSpace("C:\") /1024 $RequiredSpace="200" IF $DiskSpace < $RequiredSpace $Low="WARNING! - WARNING! : Disk space on your C: drive is low" Else $Low="" Endif $DaysLeft=365-@ydayno $rc="" $MyCPU="" $MySpeed=VAL(@MHZ) If $MySpeed < 1001 $MySpeed=("$MySpeed Mhz") Else $MySpeed=("$MySpeed Ghz") EndIf IF @INWIN=1 ; Windows NT systems $MyCPU="CPU : "+@CPU +" "+$MySpeed $IsAdmin="" SELECT CASE INGROUP("\\@WKSTA\Administrators") = 1 $IsAdmin="Yes" ENDSELECT $rc="Administrator : "+$IsAdmin ENDIF
$SMS_ID=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Client\configuration\Client Properties\","SMS Unique Identifier") $pass_age=60-@pwage
; Message Box Display Section $HDNumber = MessageBox(" Help Desk Support Number : xxx-xxx-xxxx Tie-Line : xxxx-xxxx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My User Logon ID : @UserID Full Name : @FULLNAME Operating System : @PRODUCTTYPE Build @BUILD Service Pack Level : @CSD $MyCPU $rc Current Workstation Time : @TIME Available Drive Space On C: : $DiskSpace MB $Low ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My Computer Name : @WKSTA Computer DNS Name : @HOSTNAME IP Address : $IPaddr Subnet Mask : $SNmask Default Gateway : $Gateway MAC Address : @address SMS ID : $sms_id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Days Until Password Expires : $pass_age PassWord Age : @PWAGE Logon Domain : @domain Logon Server : @LSERVER Primary NT Group : @PRIMARYGROUP Home Directory : @HOMEDIR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Microsoft Office: Access : $Ac Excel : $Ex Internet Explorer : $IEFullVer $IEName Outlook : $Ou PowerPoint : $Po Project : $Pr Publisher : $Pu Visio : $Vi Word : $Wo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My SID# : @SID ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @ydayno days have passed this year. $DaysLeft days remaining. " ,"My Computer Information",262208,0) goto end
:CheckIE ; REM ** Confirm Internet Explorer installed on system (See MS TechNet article Q164539) ; REM ** Format of IE Version numbers: x.xx.xxxx.xxxx (Major.Minor.Build.SubBuild) $RC1 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Build") ; REM ** IE3 onward (s/b build only, or xxxxx.xxxx) $RC2 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version") ; REM ** IE4 or later only (s/b xx.xx.xxxx.xxxx) $RC3 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "IVer") ; REM ** IE3 only (s/b xxx) $IECustom = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "CustomizedVersion") ; REM ** IE4 or later only: (IC = Internet Content Provider IS = Internet Service Provider CO = Corporate Administrator ) $TmpLen1 = LEN ($RC1) $TmpLen2 = LEN ($RC2) $TmpLen3 = LEN ($RC3)
SELECT CASE ($TmpLen1 = 5) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (WinXP) - MS error w/IE 6 where minor id is single charcter, and build value only 5 characters $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 1) + "0" $IEBuild = SUBSTR ($RC2, 5, 4) $IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9) $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd CASE ($TmpLen1 = 10) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (Win2K) - MS error w/IE 6 where minor id is single charcter $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 1) + "0" $IEBuild = SUBSTR ($RC2, 5, 4) $IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9) $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd CASE ($TmpLen1 = 14) OR ($TmpLen2 >= 11) ; REM ** IE5/IE4 - 14 is MS error w/IE 5.01 SP1 for Win2K, >=11 for various IE4, 5 versions not 14-character $IEFullVer = $RC2 $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 2) $IEBuild = SUBSTR ($RC2, 6, 4) $IESubBd = SUBSTR ($RC2, 11, $TmpLen2-9) CASE ($TmpLen1 >= 3) AND ($RC3 = "103") ; REM ** IE3 - the build number only $IEMajor = "4" $IEMinor = "70" $IEBuild = "$RC1" $IESubBd = "" $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild CASE (1) $Status = $Skip $wri = WRITELINE (1, "Verified IE not installed." + $CR) RETURN ENDSELECT
; REM ** Determine exact version installed on system, (See MS TechNet article Q164539) SELECT CASE ($IEFullVer >= "6.00.2600.0000") $IEVer = "6.00" $IEName="Internet Explorer 6" CASE ($IEFullVer >= "6.00.2479.0006") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta) Refresh" CASE ($IEFullVer >= "6.00.2462.0000") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta)" CASE ($IEFullVer >= "5.50.4807.2300") $IEVer = "5.50 SP2" $IEName="Internet Explorer 5.5 Service Pack 2" CASE ($IEFullVer >= "5.50.4522.1800") $IEVer = "5.50 SP1" $IEName="Internet Explorer 5.5 Service Pack 1" CASE ($IEFullVer >= "5.50.4308.2900") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Advanced Security Privacy Beta" CASE ($IEFullVer >= "5.50.4134.0600") $IEVer = "5.50" $IEName="Internet Explorer 5.5" CASE ($IEFullVer >= "5.50.4134.0100") $IEVer = "5.50" $IEName="Internet Explorer 5.5 (Windows Me - 4.90.3000)" CASE ($IEFullVer >= "5.50.4030.2400") $IEVer = "5.50" $IEName="Internet Explorer 5.5 & Internet Tools Beta" CASE ($IEFullVer >= "5.50.3825.1300") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Developer Preview (Beta)" CASE ($IEFullVer >= "5.00.3315.1000") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 2000)" CASE ($IEFullVer >= "5.00.3314.2101") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)" CASE ($IEFullVer >= "5.00.3105.0106") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)" CASE ($IEFullVer >= "5.00.3103.1000") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 2000)" CASE ($IEFullVer >= "5.00.2920.0000") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000, build 5.00.2195)" CASE ($IEFullVer >= "5.00.2919.6307") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Also included with Office 2000 SR-1)" CASE ($IEFullVer >= "5.00.2919.3800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)" CASE ($IEFullVer >= "5.00.2919.800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)" CASE ($IEFullVer >= "5.00.2516.1900") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)" CASE ($IEFullVer >= "5.00.2614.3500") $IEVer = "5.00" $IEName="Internet Explorer 5 (Windows 98 Second Edition)" CASE ($IEFullVer >= "5.00.2314.1003") $IEVer = "5.00" $IEName="Internet Explorer 5 (Office 2000)" CASE ($IEFullVer >= "5.00.2014.0216") $IEVer = "5.00" $IEName="Internet Explorer 5" CASE ($IEFullVer >= "5.00.0910.1309") $IEVer = "5.00" $IEName="Internet Explorer 5 Beta (Beta 2)" CASE ($IEFullVer >= "5.00.0518.10") $IEVer = "5.00" $IEName="Internet Explorer 5 Developer Preview (Beta 1)" CASE ($IEFullVer >= "4.72.3612.1713") $IEVer = "4.01 SP2" $IEName="Internet Explorer 4.01 Service Pack 2 (SP2)" CASE ($IEFullVer >= "4.72.3110.8") $IEVer = "4.01 SP1" $IEName="Internet Explorer 4.01 Service Pack 1 (SP1)" CASE ($IEFullVer >= "4.72.2106.8") $IEVer = "4.01" $IEName="Internet Explorer 4.01" CASE ($IEFullVer >= "4.71.1712.6") $IEVer = "4.00" $IEName="Internet Explorer 4.0" CASE ($IEFullVer >= "4.71.1008.3") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 2.0 (PP2)" CASE ($IEFullVer >= "4.71.544") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 1.0 (PP1)" CASE ($IEFullVer >= "4.70.1300") $IEVer = "3.02" $IEName="Internet Explorer 3.02 and 3.02a" CASE ($IEFullVer >= "4.70.1215") $IEVer = "3.01" $IEName="Internet Explorer 3.01" CASE ($IEFullVer >= "4.70.1158") $IEVer = "3.00" $IEName="Internet Explorer 3.0 (OSR2)" CASE ($IEFullVer >= "4.70.1155") $IEVer = "3.00" $IEName="Internet Explorer 3.0" CASE ($IEFullVer >= "4.40.520") $IEVer = "2.00" $IEName="Internet Explorer 2.0" CASE ($IEFullVer >= "4.40.308") $IEVer = "1.00" $IEName="Internet Explorer 1.0 (Plus!)" ENDSELECT RETURN
Function GetIPinfo() dim $IPinfo[3], $file, $RC, $Line, $pos, $loop IF OPEN(1,"%TEMP%\"+@WKSTA+".LOG", 5)= 0 $out = WriteLine(1, "Gathering IP info using GetIPinfo()") $x = CLOSE(1) ENDIF $file = "%TEMP%\"+@WKSTA+".LOG" if @inwin=1 shell "%comspec% /c ipconfig >$file" else shell "winipcfg /batch $file" endif $RC = Open(5, "$file", 2) if $RC = 0 $Line=Readline(5) $loop = 1 WHILE (@ERROR = 0 and $loop = 1) if instr($Line, ". . . : ") > 0 WHILE (@ERROR = 0 and $loop = 1) select case instr($Line, "IP Address") > 0 $pos = instr($Line, ":") $IPinfo[0] = substr($Line, $pos+2, 15) case instr($Line, "Subnet Mask") > 0 $IPinfo[1] = substr($Line, $pos+2, 15) case instr($Line, "Default Gateway") > 0 $IPinfo[2] = substr($Line, $pos+2, 15) if $IPinfo[2] <> "0.0.0.0" and $IPinfo[2] <> "" $loop = 0 endif endselect $Line=ReadLine(5) LOOP endif $Line=ReadLine(5) LOOP $RC=Close(5) endif $GetIPinfo = $IPinfo Endfunction
:end exit(0)
See above for notes on modifications... [ 21. September 2002, 22:22: Message edited by: NTDOC ]
|
Top
|
|
|
|
#69991 - 2002-09-19 06:38 AM
Re: My Computer Info - for Help Desk use
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Doc,
Very cool script!
An idea.. I don't know how your e-mail security is setup, but you could do something like the following: Diagnostic Tool - Do a tracert and e-mail results back to you
What do you think?
Thanks!
Kent
|
Top
|
|
|
|
#69992 - 2002-09-19 04:06 PM
Re: My Computer Info - for Help Desk use
|
Beelzel
Fresh Scripter
Registered: 2002-03-08
Posts: 46
Loc: DC Metro area
|
and the newbie goes "WOW"
any way to pipe this back to a repository (I.E. \\server\audit\@wksta.txt) along with this display??
_________________________
If not for the last minute ... nothing would get done ...
|
Top
|
|
|
|
#69993 - 2002-09-19 04:14 PM
Re: My Computer Info - for Help Desk use
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
since this is all run locally you could, PushFile() this to the client, use RmtExec() to run it, output to file, and email it, pull it remotely.
|
Top
|
|
|
|
#69995 - 2002-09-20 05:54 AM
Re: My Computer Info - for Help Desk use
|
Anonymous
Anonymous
Unregistered
|
Hello.... I have not been on the board for a very long time.
This is a great script, and I think the sugestions to the script are great, but I have not been able to find the UDF's specified: RmtExec(), and PushFile().
Thanks.
|
Top
|
|
|
|
#69997 - 2002-09-20 03:35 PM
Re: My Computer Info - for Help Desk use
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
You can find RmtExec() in the WSHPipe() UDF thread.
Push file can be found here.
|
Top
|
|
|
|
#69998 - 2002-09-20 07:28 PM
Re: My Computer Info - for Help Desk use
|
Anonymous
Anonymous
Unregistered
|
Thank you for the information. I can not wait to give this a try.
Everyone have a good weekend.
|
Top
|
|
|
|
#70001 - 2002-10-01 08:38 PM
Re: My Computer Info - for Help Desk use
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
During some testing I found that users with a screen resolution less then 1024x768 could not see all the information or the OK button. I have modified this script some to decrease the issue.
This script should now work down to 800x600 resolution. It DOES NOT work with a resolution lower then 800x600
I also added the MEMORY check... I guess I forgot all about it.
code:
; *** File Name: MYCOMP.KIX *** v1.3 ; *** Date Created: 2002-03-05 by Ron Lewis ; *** Last Date Modified: 2002-10-01 11:20 PST - By Ron Lewis ; *** CHANGE: Updated for use with GetIPinfo UDF, added CPU & Speed, and Low disk space warning. ; *** Removed the amount of days, SMS ID, USER SID so that all info would fit on 800x600 ; *** Comments: This file is called by a shortcut on the users desktop. ; *** Acknowledgments: Thanks to the following for help and ideas ; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock
BREAK On $IPaddr = EnumIPinfo(0,0) if $IPaddr = "0.0.0.0" or $IPaddr = "" $IPinfo = GetIPinfo() $IPaddr = $IPinfo[0] $SNmask = $IPinfo[1] $Gateway = $IPinfo[2] else $SNmask = EnumIPinfo(0,1) $Gateway = EnumIPinfo(0,3) endif
$nul = SETCONSOLE("hide") $HKLMAppPaths = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" ; CheckIE variables DIM $RC1, $RC2, $RC3, $TmpLen1, $TmpLen2, $TmpLen3 DIM $IEBuild, $IEFullVer, $IEMajor, $IEMinor, $IESubBd, $IEVer, $IECustom, $IEName
While @error = 0 $app = enumkey("$HKLMAppPaths\",$index) $index = $index + 1 Select case $app = "excel.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Excelver = getfileversion("$path\$app","Productversion") case $app = "winword.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Wordver = getfileversion("$path\$app","Productversion") case $app = "powerpnt.exe" $path = readvalue("$HKLMAppPaths\$app","path") $PowerPointver = getfileversion("$path\$app","Productversion") case $app = "msaccess.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Accessver = getfileversion("$path\$app","Productversion") case $app = "mspub.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Publisherver = getfileversion("$path\$app","Productversion") case $app = "winproj.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Projectver = getfileversion("$path\$app","Productversion") case $app = "visio32.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Visiover = getfileversion("$path\$app","Productversion") case $app = "outlook.exe" $path = readvalue("$HKLMAppPaths\$app","path") $Outlookver = getfileversion("$path\$app","Productversion") endselect loop
$Ex=$Excelver $Wo=$Wordver $Po=$PowerPointver $Ac=$Accessver $Pu=$Publisherver $Pr=$Projectver $Vi=$Visiover $Ou=$Outlookver
GoSub "CheckIE"
$DiskSpace = GetDiskSpace("C:\") /1024 $RequiredSpace="200" IF $DiskSpace < $RequiredSpace $Low="WARNING! - WARNING! : Disk space on your C: drive is low" Else $Low="" Endif $DaysLeft=365-@ydayno $rc="" $MyCPU="" $MySpeed=VAL(@MHZ) $Mem = MemorySize() If $MySpeed < 1001 $MySpeed=("$MySpeed Mhz") Else $MySpeed=("$MySpeed Ghz") EndIf IF @INWIN=1 ; Windows NT systems $MyCPU="CPU : "+@CPU +" "+$MySpeed $IsAdmin="" SELECT CASE INGROUP("\\@WKSTA\Administrators") = 1 $IsAdmin="Yes" Case 1 $IsAdmin="No" ENDSELECT $rc="Administrator : "+$IsAdmin ENDIF
$SMS_ID=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Client\configuration\Client Properties\","SMS Unique Identifier") $pass_age=60-@pwage
; Message Box Display Section $HDNumber = MessageBox(" Help Desk Support Number : xxx-xxx-xxx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My User Logon ID : @UserID Full Name : @FULLNAME Operating System : @PRODUCTTYPE Build @BUILD Service Pack Level : @CSD $MyCPU Memory Size : $Mem MB $rc Current Workstation Time : @TIME Available Drive Space On C: : $DiskSpace MB $Low ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My Computer Name : @WKSTA Computer DNS Name : @HOSTNAME IP Address : $IPaddr Subnet Mask : $SNmask Default Gateway : $Gateway MAC Address : @address ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Days Until Password Expires : $pass_age PassWord Age : @PWAGE Logon Domain : @domain Logon Server : @LSERVER Primary NT Group : @PRIMARYGROUP Home Directory : @HOMEDIR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Microsoft Office: Access : $Ac Excel : $Ex Internet Explorer : $IEFullVer $IEName Outlook : $Ou PowerPoint : $Po Project : $Pr Publisher : $Pu Visio : $Vi Word : $Wo " ,"My Computer Information",262208,0) goto end
:CheckIE ; REM ** Confirm Internet Explorer installed on system (See MS TechNet article Q164539) ; REM ** Format of IE Version numbers: x.xx.xxxx.xxxx (Major.Minor.Build.SubBuild) $RC1 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Build") ; REM ** IE3 onward (s/b build only, or xxxxx.xxxx) $RC2 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version") ; REM ** IE4 or later only (s/b xx.xx.xxxx.xxxx) $RC3 = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "IVer") ; REM ** IE3 only (s/b xxx) $IECustom = READVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "CustomizedVersion") ; REM ** IE4 or later only: (IC = Internet Content Provider IS = Internet Service Provider CO = Corporate Administrator ) $TmpLen1 = LEN ($RC1) $TmpLen2 = LEN ($RC2) $TmpLen3 = LEN ($RC3)
SELECT CASE ($TmpLen1 = 5) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (WinXP) - MS error w/IE 6 where minor id is single charcter, and build value only 5 characters $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 1) + "0" $IEBuild = SUBSTR ($RC2, 5, 4) $IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9) $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd CASE ($TmpLen1 = 10) AND (SUBSTR ($RC2, 4, 1) = ".") ; REM ** IE6 (Win2K) - MS error w/IE 6 where minor id is single charcter $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 1) + "0" $IEBuild = SUBSTR ($RC2, 5, 4) $IESubBd = SUBSTR ($RC2, 10, $TmpLen2-9) $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild + "." + $IESubBd CASE ($TmpLen1 = 14) OR ($TmpLen2 >= 11) ; REM ** IE5/IE4 - 14 is MS error w/IE 5.01 SP1 for Win2K, >=11 for various IE4, 5 versions not 14-character $IEFullVer = $RC2 $IEMajor = SUBSTR ($RC2, 1, 1) $IEMinor = SUBSTR ($RC2, 3, 2) $IEBuild = SUBSTR ($RC2, 6, 4) $IESubBd = SUBSTR ($RC2, 11, $TmpLen2-9) CASE ($TmpLen1 >= 3) AND ($RC3 = "103") ; REM ** IE3 - the build number only $IEMajor = "4" $IEMinor = "70" $IEBuild = "$RC1" $IESubBd = "" $IEFullVer = $IEMajor + "." + $IEMinor + "." + $IEBuild CASE (1) $Status = $Skip $wri = WRITELINE (1, "Verified IE not installed." + $CR) RETURN ENDSELECT
; REM ** Determine exact version installed on system, (See MS TechNet article Q164539) SELECT CASE ($IEFullVer >= "6.00.2600.0000") $IEVer = "6.00" $IEName="Internet Explorer 6" CASE ($IEFullVer >= "6.00.2479.0006") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta) Refresh" CASE ($IEFullVer >= "6.00.2462.0000") $IEVer = "6.00" $IEName="Internet Explorer 6 Public Preview (Beta)" CASE ($IEFullVer >= "5.50.4807.2300") $IEVer = "5.50 SP2" $IEName="Internet Explorer 5.5 Service Pack 2" CASE ($IEFullVer >= "5.50.4522.1800") $IEVer = "5.50 SP1" $IEName="Internet Explorer 5.5 Service Pack 1" CASE ($IEFullVer >= "5.50.4308.2900") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Advanced Security Privacy Beta" CASE ($IEFullVer >= "5.50.4134.0600") $IEVer = "5.50" $IEName="Internet Explorer 5.5" CASE ($IEFullVer >= "5.50.4134.0100") $IEVer = "5.50" $IEName="Internet Explorer 5.5 (Windows Me - 4.90.3000)" CASE ($IEFullVer >= "5.50.4030.2400") $IEVer = "5.50" $IEName="Internet Explorer 5.5 & Internet Tools Beta" CASE ($IEFullVer >= "5.50.3825.1300") $IEVer = "5.50" $IEName="Internet Explorer 5.5 Developer Preview (Beta)" CASE ($IEFullVer >= "5.00.3315.1000") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 2000)" CASE ($IEFullVer >= "5.00.3314.2101") $IEVer = "5.01 SP2" $IEName="Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)" CASE ($IEFullVer >= "5.00.3105.0106") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)" CASE ($IEFullVer >= "5.00.3103.1000") $IEVer = "5.01 SP1" $IEName="Internet Explorer 5.01 SP1 (Windows 2000)" CASE ($IEFullVer >= "5.00.2920.0000") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000, build 5.00.2195)" CASE ($IEFullVer >= "5.00.2919.6307") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Also included with Office 2000 SR-1)" CASE ($IEFullVer >= "5.00.2919.3800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)" CASE ($IEFullVer >= "5.00.2919.800") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)" CASE ($IEFullVer >= "5.00.2516.1900") $IEVer = "5.01" $IEName="Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)" CASE ($IEFullVer >= "5.00.2614.3500") $IEVer = "5.00" $IEName="Internet Explorer 5 (Windows 98 Second Edition)" CASE ($IEFullVer >= "5.00.2314.1003") $IEVer = "5.00" $IEName="Internet Explorer 5 (Office 2000)" CASE ($IEFullVer >= "5.00.2014.0216") $IEVer = "5.00" $IEName="Internet Explorer 5" CASE ($IEFullVer >= "5.00.0910.1309") $IEVer = "5.00" $IEName="Internet Explorer 5 Beta (Beta 2)" CASE ($IEFullVer >= "5.00.0518.10") $IEVer = "5.00" $IEName="Internet Explorer 5 Developer Preview (Beta 1)" CASE ($IEFullVer >= "4.72.3612.1713") $IEVer = "4.01 SP2" $IEName="Internet Explorer 4.01 Service Pack 2 (SP2)" CASE ($IEFullVer >= "4.72.3110.8") $IEVer = "4.01 SP1" $IEName="Internet Explorer 4.01 Service Pack 1 (SP1)" CASE ($IEFullVer >= "4.72.2106.8") $IEVer = "4.01" $IEName="Internet Explorer 4.01" CASE ($IEFullVer >= "4.71.1712.6") $IEVer = "4.00" $IEName="Internet Explorer 4.0" CASE ($IEFullVer >= "4.71.1008.3") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 2.0 (PP2)" CASE ($IEFullVer >= "4.71.544") $IEVer = "4.00" $IEName="Internet Explorer 4.0 Platform Preview 1.0 (PP1)" CASE ($IEFullVer >= "4.70.1300") $IEVer = "3.02" $IEName="Internet Explorer 3.02 and 3.02a" CASE ($IEFullVer >= "4.70.1215") $IEVer = "3.01" $IEName="Internet Explorer 3.01" CASE ($IEFullVer >= "4.70.1158") $IEVer = "3.00" $IEName="Internet Explorer 3.0 (OSR2)" CASE ($IEFullVer >= "4.70.1155") $IEVer = "3.00" $IEName="Internet Explorer 3.0" CASE ($IEFullVer >= "4.40.520") $IEVer = "2.00" $IEName="Internet Explorer 2.0" CASE ($IEFullVer >= "4.40.308") $IEVer = "1.00" $IEName="Internet Explorer 1.0 (Plus!)" ENDSELECT RETURN
Function GetIPinfo() dim $IPinfo[3], $file, $RC, $Line, $pos, $loop IF OPEN(1,"%TEMP%\"+@WKSTA+".LOG", 5)= 0 $out = WriteLine(1, "Gathering IP info using GetIPinfo()") $x = CLOSE(1) ENDIF $file = "%TEMP%\"+@WKSTA+".LOG" if @inwin=1 shell "%comspec% /c ipconfig >$file" else shell "winipcfg /batch $file" endif $RC = Open(5, "$file", 2) if $RC = 0 $Line=Readline(5) $loop = 1 WHILE (@ERROR = 0 and $loop = 1) if instr($Line, ". . . : ") > 0 WHILE (@ERROR = 0 and $loop = 1) select case instr($Line, "IP Address") > 0 $pos = instr($Line, ":") $IPinfo[0] = substr($Line, $pos+2, 15) case instr($Line, "Subnet Mask") > 0 $IPinfo[1] = substr($Line, $pos+2, 15) case instr($Line, "Default Gateway") > 0 $IPinfo[2] = substr($Line, $pos+2, 15) if $IPinfo[2] <> "0.0.0.0" and $IPinfo[2] <> "" $loop = 0 endif endselect $Line=ReadLine(5) LOOP endif $Line=ReadLine(5) LOOP $RC=Close(5) endif $GetIPinfo = $IPinfo Endfunction
:end exit(0)
|
Top
|
|
|
|
#70002 - 2002-10-15 06:40 PM
Re: My Computer Info - for Help Desk use
|
Anonymous
Anonymous
Unregistered
|
Thought this was a great script, I did notice there is an issue with the visio. If the user or users have the newest visio (2002) installed, the script does not pick it up. I changed the visio32.exe to visio.exe and works fine. Just thought I would comment.
Thanks for a great script.
|
Top
|
|
|
|
#70005 - 2002-11-05 10:59 PM
Re: My Computer Info - for Help Desk use
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
You're quite welcome jtrainer...
Note this though:
*** Acknowledgments: Thanks to the following for help and ideas; *** Shawn, Bryce, Fabian, bleonard, and Howard Bullock
I put it together from ideas and code from others as well.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 700 anonymous users online.
|
|
|