Showing posts with label vbs. Show all posts
Showing posts with label vbs. Show all posts

Monday, November 14, 2011

HowTo: Pretend you are working (While Text Browsing)

Commandline Web Browser (Just like lynx) using VbScript and IE API.

About the code: The code below will use the Internet Explorer API to load the top 20 stories from google news and choosing one of the article will load the document html of the target URL for you to be able to read news from your DOS command line. Best way to look like you are still working on a code while actually reading news without opening any web browsers :p

Requirements: IE 6++

Code Snippet:

Sub Loadnews()
Dim arrTestArray()
Dim urlSelect
intSize = 0
Dim rInterval:rInterval=60
Dim sTime:sTime = Now
Set ie = CreateObject("InternetExplorer.Application")
with ie
.visible = 0
.navigate "http://news.google.com/"
WScript.StdOut.Write vbcrlf & vbtab & "Loading Top Stories for @ " & Now
while .busy
WScript.StdOut.Write "."
WScript.Sleep 1000
wend
WScript.Echo vbcrlf & vbtab & "elapsed : " & datediff("s",sTime,Now) & " secs"
WScript.Echo vbtab & "next refresh: " & dateadd("s",rInterval,Now) & " secs" & vbcrlf
dim ctr:ctr=1
Set newsTitle = .Document.getElementsByTagName("a")
For each xTag in newsTitle
If instr(xTag.InnerHTML,"titletext") >0 then
WScript.Echo vbcrlf & vbtab & ctr & ". " & xTag.InnerText & _
"..." & vbcrlf & vbTab & "[" & xTag & "]"
ctr = ctr + 1
ReDim Preserve arrTestArray(intSize)
arrTestArray(intSize) = xTag
intSize = intSize + 1
If ctr >20 Then Exit For
End If
Next
end with
ie.quit
Set ie = nothing
Dim sleepctr:sleepctr=1
WScript.StdOut.Write vbcrlf & vbtab & "Choose an article #: "

urlSelect = WScript.StdIn.ReadLine
Set ie = CreateObject("InternetExplorer.Application")
Dim tgt:tgt=arrTestArray(urlSelect-1)
with ie
.navigate tgt
WScript.StdOut.Write vbcrlf & vbtab & "Loading [URL]..." & arrTestArray(urlSelect-1)
while .busy
WScript.StdOut.Write "."
WScript.Sleep 1000
wend
WScript.Echo .Document.Body.InnerText
end with
WScript.StdOut.Write vbcrlf & vbtab & "Press any key to continue..."
jcontinue = WScript.StdIn.ReadLine

End Sub


Screen grab:



If at first you fail, call it version 1.0

Thursday, September 13, 2007

HowTo: Enum Citrix Server License using LMSTAT

Our PS4 server seems to fail to execute the license information scripts from Citrix.Com (Dependency on SDK).

So instead of relying on it, I decided to develop a script using LMSTAT and a short vb script to parse the output file and write it to a .CSV file for better viewing (Data Filtering and such...)

First I piped the result of lmstat -a to a text file then I used the script below to parse the contents then write it to a .CSV file

Code Snippet:

Parse the source file (lmstat output file): srcfile

  1. Sub GetData(srcfile)
  2. Set f = fso.GetFile(srcfile)
  3. Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
  4. Do While ts.AtEndOfStream <> True
  5. readResults = Trim(UCase(ts.ReadLine))
  6. If InStr(readResults, "/27000") Then
  7. mps = split(readResults, Chr(32))
  8. msg = mps(1) & "," & mps(3) &amp; "," & mps(4) &amp;amp; "," & mps(5) & mps(6) & mps(8) &amp;amp; " " & mps(9) &amp;amp; " " & mps(10)
  9. WriteToCSV msg, license_out
  10. End If
  11. Loop
  12. End Sub

Write to CSV function: oCsv(Output File), msg(parsed ReadLine results)


  1. Function WriteToCSV(oCsv,msg)
  2. If Not fso.FileExists(oCsv) Then fso.CreateTextFile(oCsv)
  3. Set f = fso.GetFile(oCsv)
  4. Set ts = f.OpenAsTextStream(ForAppending, TristateUseDefault)
  5. ts.Write msg & vbCrlf
  6. msg = ""
  7. ts.Close
  8. End Function
If at first you fail, call it version 1.0

Wednesday, September 12, 2007

Event Log

Event Log Manipulations:

1. Reading the Event Log
2. Clearing the Event Log
3. Creating backup of the Event Log

Code Snippet #1:

  1. strComputer = "."
  2. Set objWMIService = GetObject("winmgmts:" _
  3. & "{impersonationLevel=impersonate}!\\" _
  4. & strComputer & "\root\cimv2")
  5. Set colLoggedEvents = objWMIService.ExecQuery _
  6. ("Select * from Win32_NTLogEvent " _
  7. & "Where Logfile = 'System'")
  8. For Each objEvent in colLoggedEvents
  9. Wscript.Echo "Category: " &amp; objEvent.Category & VBNewLine _
  10. &amp;amp; "Computer Name: " & objEvent.ComputerName & VBNewLine _
  11. & "Event Code: " & objEvent.EventCode & VBNewLine _
  12. & "Message: " & objEvent.Message & VBNewLine _
  13. & "Record Number: " & objEvent.RecordNumber & VBNewLine _
  14. & "Source Name: " & objEvent.SourceName & VBNewLine _
  15. & "Time Written: " & objEvent.TimeWritten & VBNewLine _
  16. &amp;amp; "Event Type: " & objEvent.Type & VBNewLine _
  17. & "User: " & objEvent.User
  18. Next


Code Snippet #2:

  1. strComputer = "."
  2. Set objWMIService = GetObject("winmgmts:" _
  3. & "{impersonationLevel=impersonate,(Backup)}!\\" & _
  4. strComputer & "\root\cimv2")
  5. Set colLogFiles = objWMIService.ExecQuery _
  6. ("Select * from Win32_NTEventLogFile " _
  7. & "Where LogFileName='Application'")
  8. For Each objLogfile in colLogFiles
  9. objLogFile.ClearEventLog()
  10. WScript.Echo "Cleared application event log file"
  11. Next

Code Snippet #3:


  1. strComputer = "."
  2. Set objWMIService = GetObject("winmgmts:" _
  3. & "{impersonationLevel=impersonate,(Backup)}!\\" & _
  4. strComputer & "\root\cimv2")
  5. Set colLogFiles = objWMIService.ExecQuery _
  6. ("Select * from Win32_NTEventLogFile " _
  7. & "Where LogFileName='Application'")
  8. For Each objLogfile in colLogFiles
  9. errBackupLog = objLogFile.BackupEventLog( _
  10. "c:\scripts\application.evt")
  11. WScript.Echo "File saved as c:\scripts\applications.evt"
  12. Next
If at first you fail, call it version 1.0

Thursday, June 28, 2007

HowTo: Add cmd.exe to right click context menu

If you want the command prompt to be available whenever you right click on objects on your desktop or explorer, you can opt to create the keys in the registry:

  • HKEY_CLASSES_ROOT\Folder\shell\MenuText\Command

Change the (Default) value to cmd.exe /k cd "%1"

Or you can script it!

Code Snippet:
  1. Const HKEY_CLASSES_ROOT = &H80000000
  2. Const HKEY_CURRENT_USER = &H80000001
  3. Dim WSHShell, objWMIService, strComputer, lcValue1
  4. strComputer = "."
  5. Set objWMIService = GetObject("winmgmts:\\" & strComputer &amp;amp; "\root\cimv2")
  6. Set objWSHShell = WScript.CreateObject("WScript.Shell")
  7. Set objRegObj = WScript.CreateObject("RegObj.Registry")
  8. objWSHShell.Popup "This will enable CMD with explorer options for the Current User"
  9. objWSHShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\", "cmd.exe /k cd " & chr(34) & "%1" & chr(34)
  10. objWSHShell.RegWrite "HKCR\Folder\Shell\MenuText\", "Launch CMD"
  11. tmp = objWSHShell.RegRead("HKCR\Folder\Shell\MenuText\")
  12. objWSHShell.Popup ("Current Value: " + tmp)

If at first you fail, call it version 1.0

Bytes Converter Function

A simple function that converts Bytes to GB, MB or KB.

Code Snippet:

  1. Function SetBytes(Bytes,fKB)
  2. if fKB=True then Bytes = Bytes * 1024
  3. If Bytes >= 1073741824 Then
  4. SetBytes = FormatNumber((Bytes / 1024 / 1024 / 1024),2,,-1,-1) & " GB"
  5. ElseIf Bytes >= 1048576 Then
  6. SetBytes = FormatNumber((Bytes / 1024 / 1024),2,,-1,-1) & " MB"
  7. ElseIf Bytes >= 1024 Then
  8. SetBytes = FormatNumber((Bytes / 1024),2,,-1,-1) & " KB"
  9. ElseIf Bytes < 1024 Then
  10. SetBytes = Bytes & " Bytes"
  11. End If
  12. End Function

Usage: SetBytes(Size,true\false)

If at first you fail, call it version 1.0

Tuesday, June 26, 2007

WMI Ping (Win32_PingStatus)

The code below is an example in how to use Win32_PingStatus class in WMI to check a remote machine's status on the network.

Code Snippet:

  1. Function PingHost(sTarget)
  2. Set cPingResults = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _
  3. sHost & "/root/cimv2"). ExecQuery("SELECT * FROM Win32_PingStatus " & _
  4. "WHERE Address = '" + sTarget + "'")
  5. For Each oPingResult In cPingResults
  6. If oPingResult.StatusCode = 0 Then
  7. If LCase(sTarget) = oPingResult.ProtocolAddress Then
  8. WScript.Echo sTarget & " is responding"
  9. Else
  10. WScript.Echo sTarget & "(" & oPingResult.ProtocolAddress &amp; ") is responding"
  11. End If
  12. Wscript.Echo "Bytes = " & vbTab & oPingResult.BufferSize & _
  13. vbTab & "Time (ms) = " & vbTab & oPingResult.ResponseTime & _
  14. vbTab & "TTL (s) = " & vbTab & oPingResult.ResponseTimeToLive & _
  15. vbTab & "Hostname = " & vbTab & oPingResult.ProtocolAddressResolved
  16. Else
  17. WScript.Echo sTarget & " is not responding"
  18. WScript.Echo "Status code is " & oPingResult.StatusCode
  19. WScript.Echo "*********************************"
  20. End If
  21. Next
  22. End Function

If at first you fail, call it version 1.0

Monday, June 18, 2007

ADSI Kixtart UDF for Citrix login

Having a mixed mode environment gave us a lot of hassle when logging in to NT and querying group membership in AD... Specially in our case, we have nested OU's...

Ifmember.exe is useful for this problem but it does cause a slight delay in the login process and the users are complaining on the slow login session, some couldn't wait and cancels the connection... catastrophic experience ends up as a global complain... hmmm... some people are just impatient...

So to be able to execute an ADSI query through kix login script the function below can be inserted anywhere in the login script to perform InGroup query... or this can fully replace the built in InGroup function in kixtart.


Code Snippet:

  1. Function fnInGroupAD($sGroup,Optional $bComputer)
  2. Dim $objSys,$objTarget,$aMemberOf,$sMemberOf
  3. $objSys = CreateObject("ADSystemInfo")
  4. $objTarget = GetObject("LDAP://"+Iif($bComputer,$objSys.ComputerName,$objSys.UserName))
  5. $aMemberOf = $objTarget.GetEx("memberOf")
  6. For Each $sMemberOf in $aMemberOf
  7. If InStr($sMemberOf,"CN="+$sGroup+",")
  8. $fnInGroupAD = Not 0
  9. Exit
  10. EndIf
  11. Next
  12. $fnInGroupAD = NOT 1
  13. EndFunction

If at first you fail, call it version 1.0

Saturday, June 16, 2007

Windows Management Instrumentation Command-line (WMIC) tool

I previously posted an article regarding wbemtest that can be utilized in performing wmi query.

I recently visited M$oft and found an article on wmi command-line.

It was a good read and I was pleased to know that it provides you a simple command-line interface to Windows Management Instrumentation (WMI).

If you’ve never used WMIC, open a command prompt and type: WMIC

You should get a brief installation message followed by a WMIC prompt. You can type exit to return to the command prompt. WMIC has an interactive mode like NSLOOKUP or you can access it directly from the command line.

For example, run "wmic os get caption,csdversion", then you should get something like this:

Caption CSDVersion
Microsoft Windows XP Professional Service Pack 2


Type WMIC /? to view more info.

Note:
Use the /RECORD global switch to redirect WMIC output to a file.


If at first you fail, call it version 1.0

Double System State Backup

We have a scheduled System State backup running on our Web Server.

To save the extra cost of software and hardware backups, I wrote a script that copies the System State backup to folders named after the date the backup was performed.

With this, it's easier for us to restore backups for particular days without having too much hassels.

Code Snippet:

'---------------------------------------------
' System State Backup Configuration
' Logfile naming, Source and Destination folders
'---------------------------------------------

  1. Const ForReading = 1, ForWriting = 2, ForAppending = 8
  2. Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
  3. Dim SysBakName, CurDate, SysBakSrc, SysBakRoot, mssg
  4. Dim hTime, mTime, sTime, nTime
  5. 'System State Backup Filename
  6. SysBakName = ""
  7. 'System State Backup Source Path
  8. SysBakSrc = ""
  9. 'System State Backup Destination Root
  10. SysBakRoot = ""
  11. 'System State Log File
  12. SysBakLog = ""
  13. hTime = Hour(Time)
  14. mTime = Minute(Time)
  15. sTime = Second(Time)
  16. if hTime < 10 then
  17. hTime = "0" & hTime
  18. end if
  19. if hTime = "00" then
  20. hTime = "24"
  21. end if
  22. if mTime < 10 then
  23. mTime = "0" & mTime
  24. end if
  25. if sTime < 10 then
  26. sTime = "0" & sTime
  27. end if
  28. nTime = hrs & hTime & ":" & mTime & ":" & sTime


'----------------------------------------
' System State Backup Modules
'----------------------------------------


  1. Sub BackDest(CurDate)
  2. Select Case CurDate
  3. Case "MON"
  4. BakDestination = "Monday"
  5. Case "TUE"
  6. BakDestination = "Tuesday"
  7. Case "WED"
  8. BakDestination = "Wednesday"
  9. Case "THU"
  10. BakDestination = "Thursday"
  11. Case "FRI"
  12. BakDestination = "Friday"
  13. Case "SAT"
  14. BakDestination = "Saturday"
  15. Case "SUN"
  16. BakDestination = "Sunday"
  17. Case Else
  18. mssg = "Unable to determine backup destination path!"
  19. WriteMssg mssg
  20. End Select
  21. CopyBak BakDestination
  22. End Sub

Start the backup process:

  1. Sub StartBackup()
  2. CurDate = (FormatDateTime(Date(),1))
  3. CurDate = UCase(Trim(CurDate))
  4. CurDate = Left(CurDate, "3")
  5. BackDest CurDate
  6. End Sub
  7. Sub CopyBak(BakDestination)
  8. Dim filesys, SysBakFile, SysBakSrcFull
  9. SysBakSrcFull = SysBakSrc & "\" & SysBakName
  10. Set filesys = CreateObject("Scripting.FileSystemObject")
  11. Set SysBakFile = filesys.GetFile(SysBakSrcFull)
  12. BakDestination = SysBakRoot & "\" & BakDestination &amp; "\"
  13. SysBakFile.Copy(BakDestination)
  14. mssg = SysBakSrcFull & " copied to " & _
  15. BakDestination & SysBakName &amp;amp;amp;amp;amp; _
  16. " - " & nTime
  17. WriteMssg mssg
  18. End Sub
Write the process into a log file:
  1. Sub WriteMssg(mssg)
  2. Dim fso, f, ts
  3. Set fso = CreateObject("Scripting.FileSystemObject")
  4. If Not fso.FileExists(SysBaklog) then
  5. fso.CreateTextFile SysBakLog
  6. End If
  7. Set f = fso.GetFile(SysBakLog)
  8. Set ts = f.OpenAsTextStream(ForAppending, TristateUseDefault)
  9. ts.WriteLine mssg
  10. ts.Close
  11. 'mssg = ""
  12. End Sub
  13. Sub StartLog()
  14. Dim TimeNow
  15. TimeNow = (FormatDateTime(Date(),1))
  16. mssg = "System State Backup started on " & _
  17. TimeNow & " - " & nTime
  18. WriteMssg mssg
  19. End Sub

If at first you fail, call it version 1.0

Monday, June 11, 2007

Viral detection on multiple page loads

Aside from having too much page loads detected as being viral, too much query from a single point of origin is also detected as viral... now this is the time that when the search results will prompt you for message that this query format is detected as virus and will ask you to key in the confirmation code to confirm that it was a valid search query.

Anyway, since ie will just crash your machine when performing too much page load and queries, I have written another scriptlet that utilizes MSXML2.ServerXMLHTTP.4.0 instead, so no api calls are made to unreliable but wonderfully obedient ie.

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.4.0")

'::::: Set your proxy here, comment it if not required


xmlhttp.setProxy 2,"10.1.1.1:8080"

'::::: Open the url using http Get

xmlhttp.open "GET", purl, false

You may use the following as part of your query URL:

InURL:Index.Of?mp3 InText:Index.Of?mp3 InTitle:Index.Of?mp3 InURL:Top Keywords InText:Top Keywords InTitle:Top Keywords InURL:scripts InText:scripts InTitle:scripts InURL:niche InText:niche InTitle:niche InURL:adsense InText:adsense InTitle:adsense InURL:income InText:income InTitle:income InURL:3gp InText:3gp InTitle:3gp InURL:hotel InText:hotel InTitle:hotel InURL:travel InText:travel InTitle:travel InURL:medicine InText:medicine InTitle:medicine InURL:new InText:new InTitle:new InURL:best InText:best InTitle:best InURL:rare InText:rare InTitle:rare InURL:free InText:free InTitle:free InURL:finance InText:finance InTitle:finance InURL:movie InText:movie InTitle:movie InURL:download InText:download InTitle:download InURL:source InText:source InTitle:source InURL:game InText:game InTitle:game InURL:music InText:music InTitle:music InURL:audio InText:audio InTitle:audio InURL:film InText:film InTitle:film InURL:digital InText:digital InTitle:digital InURL:flight InText:flight InTitle:flight InURL:school


':::::: Make sure you define your Browser Agent or else queries will not be allowed and will prompt you for blocks of code that you might need to submit to rectify the malformed query.

xmlhttp.setRequestHeader "User-Agent","Microsoft Internet Explorer"


xmlhttp.send()


':::::: You can do anything with the search results, follow the links, blah
WScript.Echo xmlhttp.responseText

set xmlhttp = nothing


If at first you fail, call it version 1.0

Tuesday, June 05, 2007

1,000 eCPM can earn you only $0.01

Just a script that does nothing but loads a page repeatedly...
Hmmm... might be useful or not useful...
Can It be used to accumulate eCPM?

Totally up to you...

psURL = "Your desired url..."
psURL2 = "Second desired url..."
Dim x
Dim IE

x=0
Set IE = CreateObject("InternetExplorer.Application")

With IE
.menubar=0

.toolbar=0
.statusBar=0
.navigate psURL
.visible=0
.resizable=1
Do while .busy
Loop

Do While x < "desired amout of page loads"
WScript.Echo Now & " - Count Load: " & x
.navigate2 psURL
WScript.Echo Now & " - Loaded: " & psURL
Do while .busy
Loop

x =x + 1
WScript.Echo Now & " - 15sec sleep..."
WScript.Sleep(15000)
.navigate2 psURL2
WScript.Echo Now & " - Loaded: " & psURL2
Loop
End With




Monday, May 21, 2007

Powershell Lynx Project

Those were the days of Lynx when you used to browse the web as text thru the console...

My previous blogs were about scripting with Yahoo api search services. Well, since blogging at work is not really encouraged, I have decided to create my powershell version of Lynx. Since I'm scripting most of the time due to adHoc script requests, my boss won't even realize that I'm actually blogging... hehehe...

For starters, a scriptlet that navigates IE:

$ie = New-Object -com InternetExplorer.Application
$ie.Visible=$true
$ie.MenuBar=$false
$ie.ToolBar=$false
$ie.StatusBar=$false
$ie.Navigate("http://26thgstreet.blogspot.com")


Visibility of IE can be set to false later after I finalized the function to get the HTMLDocument.Innertext and write it to the console.

I will aso have to create a function to accept console arguments to be posted to the HTMLDocument so that I can update my blogs...

Stay tuned for the script updates.



Friday, May 18, 2007

Yahoo Search Script

Something to share...

Using MsXML.DOMDocument, you will be able to query Yahoo! API (
http://api.search.yahoo.com/WebSearchService/V1/webSearch?) .

Query Parameters used:


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Yahoo Search Script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Const APP_ID = "insert your app ID"

'Grab the incoming search query or ask for one
If WScript.Arguments.Length = 0 Then
strQuery = InputBox("Enter a search Term")
Else
strQuery = WScript.Arguments(0)
End If

'Construct a Yahoo! Search Query
strLanguage = "en"
strReqURL = "http://api.search.yahoo.com/" & _
"WebSearchService/V1/webSearch?" & _
"appid=" & APP_ID & _
"&query=" & strQuery & _
"&language=" & strLanguage

'Start the XML Parser
Set MSXML = CreateObject("MSXML.DOMDocument")

'Set the XML Parser options
MSXML.Async = False

'Make the Request
strResponse = MSXML.Load(strReqURL)

'Make sure the request loaded
If (strResponse) Then

'Load the results
Set Results = MSXML.SelectNodes("//Result")

'Loop through the results
For x = 0 to Results.length - 1
strTitle = Results(x).SelectSingleNode("Title").text
strSummary = Results(x).SelectSingleNode("Summary").text
strURL = Results(x).SelectSingleNode("Url").text
strOut = (x + 1) & ". " & _
strTitle & vbCrLf & _
strSummary & vbCrLf & _
strURL & vbCrLf & vbCrLf
WScript.Echo strOut
Next

'Unload the results
Set Results = Nothing

End If

'Unload the XML Parser
Set MSXML = Nothing
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Thursday, May 17, 2007

CPU Temp Probes

I have searched the web for a script that performs temperature probes but had no luck in getting the real picture until wbemtest helped me find classes not included in M$oft's Scriptomatic.

Follow the instructions below to test if the script will work on your machine for CPU temperature probe:

1. Launch wbemtest


2. Click connect


3. Change the namespace to "root\WMI" then click Connect


4. Click Query, supply the query "Select * from MSAcpi_ThermalZoneTemperature" , then click Apply


5. Double click on the result to view the class properties:


If you are able to view the results then it's ok to proceed with the scriplet.

Below is the script that probes for CPU temperature via MSAcpi_ThermalZoneTemperature. The initial results are in 10ths of degrees in Kelvin so I had to convert the results to Celcius and Farenheit.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CPU Temperature Probe
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery("Select * from MSAcpi_ThermalZoneTemperature",,48)
For Each objItem in colItems

With objItem
WScript.Echo "Active: " & .Active & vbcrlf

FarTemp = ((9/5)*((.CurrentTemperature - 2732)/10)) + 32
CelTemp = ((FarTemp - 32) * (5/9))
WScript.Echo "Current Temperature: " & vbcrlf & _
FarTemp & " (Degrees Farenheit)" &amp;amp;amp;amp;amp; _
" | " & CelTemp & " (Degrees Celcius)" & vbcrlf

FarTemp=((9/5)*((.CriticalTripPoint - 2732)/10)) + 32
CelTemp = ((FarTemp - 32) * (5/9))
WScript.Echo "Critical Temperature (Temperature at which the OS must shutdown the system): " &amp;amp;amp;amp; vbcrlf & _
FarTemp & " Degrees Farenheit" & _
" | " & CelTemp & " Degrees Celcius" & vbcrlf

If .PassiveTripPoint <> 0 Then
FarTemp=((9/5)*((.PassiveTripPoint - 2732)/10)) + 32
CelTemp = ((FarTemp - 32) * (5/9))
WScript.Echo "Passive Temperature (Temperature at which the OS must activate CPU throttling): " &amp;amp;amp;amp; vbcrlf & _
FarTemp & " Degrees Farenheit" & _
vbcrlf & CelTemp & " Degrees Celcius" & vbcrlf
End If

WScript.Echo "Thermal Stamp: " & .ThermalStamp & vbcrlf
End With
Next
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

CPU Max Temperatures

AMD Althon, Althon Opteron, Duron & Sempron Series:

  • AMD Athlon (socket) upto 1Ghz 90°C
  • AMD Athlon (slot) all speeds 70°C
  • AMD Athlon Thunderbird 1.1Ghz+ 95°C
  • AMD Athlon MP 1.33Ghz+ 95°C
  • AMD Athlon XP 1.33Ghz+ 90°C
  • AMD Athlon XP T-Bred upto 2100+ 90°C
  • AMD Athlon XP T-Bred over 2100+ 85°C
  • AMD Athlon XP Barton 85°C
  • AMD Duron up to 1Ghz 90°C
  • AMD Duron 1Ghz+ 90°C
  • AMD Duron Applebred 85°C
  • AMD Opteron 65 - 71°C
  • AMD Athlon 64 70°C
  • AMD Athlon 64 (Socket 939, 1.4 volts) 65°C
  • AMD Athlon 64 FX 70°C
  • AMD Athlon 64 X2 71°C
  • AMD Sempron (T-bred/Barton core) 90°C
  • AMD Sempron (Paris core) 70°C
  • AMD Mobile Sempron 95°C

AMD K6 Series
  • AMD K6/K6-2/K6-III (All except below) 70°C
  • AMD K6-2/K6-III (model number ending in X) 65°C
  • AMD K6-2+/K6-III+ 85°C

Intel Pentium III Series
  • Pentium III Slot 1 500-866Mhz 80°C
  • Pentium III Slot and socket 933Mhz 75°C
  • Pentium III Slot 1 1Ghz 60 - 70°C
  • Pentium III Slot 1 1.13Ghz 62°C

Intel Celeron Series
  • Intel Celeron 266-433Mhz 85°C
  • Intel Celeron 466-533Mhz 70°C
  • Intel Celeron 566-600Mhz (Coppermine) 90°C
  • Intel Celeron 633-667Mhz 82°C
  • Intel Celeron 700 - 850Mhz 80°C
  • Intel Celeron 900Mhz - 1.6Ghz 69 - 70°C
  • Intel Celeron 1.7Ghz and Higher 67 - 77°C

Intel Pentium II
  • Intel Pentium II (First Generation "Klamath") 72 - 75°C
  • Intel Pentium II (Second Generation, 266-333Mhz) 65°C
  • Intel Pentium II (350 - 400Mhz) 75°C
  • Intel Pentium II (450Mhz) 70°C

Intel Pentium 4, Pentium M (notebooks)
  • Intel Pentium 4 64 - 78°C
There are no specific stats for Pentium 4 CPU’s as P4’s have an ability to slow themselves down when they are getting too hot and thus, in theory they should never be able to burn themselves out. To get specifics consult Intel’s specifications for your particular model.

  • Intel Pentium M (notebooks) 100°C

Intel Pentium D (dual core)
  • Intel Pentium D 820 (2.8Ghz) 63°C
  • Intel Pentium D 830 & 840 (3.0 - 3.2Ghz) 69.8°C

Intel Pentium Pro
  • Intel Pentium Pro. 256 or 512K L2 Cache 85°C
  • Intel Pentium Pro. 1MB L2 Cache 80°C