 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AnttiV
Joined: 14 Aug 2009 Posts: 237 Location: Finland
|
Posted: Mon Aug 31, 2009 10:36 pm Post subject: Way to retrieve system information |
|
|
Hi,
I'm trying to write a script to help tech support. A single-run script that outputs a textfile to A_MyDocuments and then displays it so the user can just copy-paste it into an email and/of forum post.
I read through some posts (other SysInfo scripts), but none of them provided some of the things I need.
I got the framework working (well that wasn't even hard), but a few spots still elude me. I need to get
1) CPU Speed.
2) OS version number (not A_OSVersion, as that gives too vague results. I need a number to distinguish if WIN_VISTA is Vista or Windows 7...)
3) Installed Service Pack version, and preferable OS Build version.
If possible, the state of firewall/antivirus (up-to-date/old/not available) from the security center.
There might be something else, but I don't remember right now. I got most of the stuff working already, so there's some info written.
Script doesn't need to work on anything older than XP. |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Mon Aug 31, 2009 11:03 pm Post subject: |
|
|
Tested on XP, if it doesn't work on vista, just find the new reg location
| Code: |
#NoTrayIcon
;Speed
Loop
{
RegRead Speed%A_Index%, HKEY_LOCAL_MACHINE, % "HARDWARE\DESCRIPTION\System\CentralProcessor\" . (A_Index-1), ProcessorNameString
if Speed%A_Index% <>
speed .= Speed%A_Index% . "`n"
Break
}
;Version
RegRead v1, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, ProductName
RegRead v2, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CSDVersion
Version := v1 . " " . v2
Gui Add, Edit, Readonly, % Speed . Version
Gui Show
return
GuiClose:
ExitApp
|
|
|
| Back to top |
|
 |
AnttiV
Joined: 14 Aug 2009 Posts: 237 Location: Finland
|
Posted: Mon Aug 31, 2009 11:17 pm Post subject: |
|
|
Just noticed that myself I found these.
| Code: | RegRead, CPUNAme, HKEY_LOCAL_MACHINE, HARDWARE\DESCRIPTION\System\CentralProcessor\0, ProcessorNameString
RegRead, BuildNum, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentBuild
RegRead, OSName, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, ProductName
RegRead, WinVersion, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentVersion
|
What I still am missing is, OS "bitcount" (x86/x64). I thought the OS version strings would've included that somewhere, but no. Then I'd like to know the latest SP version, if any. |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
|
| Back to top |
|
 |
AnttiV
Joined: 14 Aug 2009 Posts: 237 Location: Finland
|
Posted: Mon Aug 31, 2009 11:26 pm Post subject: |
|
|
Yes, I'm using that string already, but it only tells if the CPU is *capable* of 64bits, not if the installed OS is 64 or 32bits. Most modern CPUs are 64bit (for a few years already) but still many, many are using 32bit OS'es.
If that pages tells me how to get that info (with an AHK script), then sorry I'm blind but I couldn't see any.
EDIT: From the page
| Quote: | | From ProcessorNameString you will be able to see the name of your processor and from Identifier you will see the family of the processor and if it has 64 then it is 64-bit capable. |
EDIT2: I found a x64/x86 detection method from this post
EDIT3: I also found a registry key for the service pack, yay!
now I'm only (mostly) missing product-specific information, and for that I need to ask the guys who actually make the things... Thanks for help  |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Oct 31, 2009 7:43 pm Post subject: |
|
|
Could you please post the regkey for servicepack?
Thanks |
|
| Back to top |
|
 |
pkutter
Joined: 18 Mar 2009 Posts: 17 Location: Minnesota, USA
|
Posted: Sat Oct 31, 2009 8:02 pm Post subject: |
|
|
I found it.
| Code: | | RegRead, ServicePack, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CSDVersion |
|
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Thu Nov 19, 2009 4:16 pm Post subject: |
|
|
I'm also trying to find out this info for a simple system info display for XP, Vista or Windows 7.
Any ideas if Vista and W7 will run the reg reads the same way?
I'm going also Google them and report back..
edit::
Ok I fired up the Vista machine and it the Reg keys work ..
Onto W7... _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 19, 2009 5:40 pm Post subject: |
|
|
on w7 32bit pro
 |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 19, 2009 7:33 pm Post subject: |
|
|
same OS @ netbook
 |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Thu Nov 19, 2009 9:32 pm Post subject: |
|
|
Is the code several posts up for the above GUI?
I had my own
| Code: | FileDelete, % A_Desktop "\Computer Specs.txt"
RegRead, ServicePack, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CSDVersion
spaceCount=
Loop
{
RegRead Speed%A_Index%, HKEY_LOCAL_MACHINE, % "HARDWARE\DESCRIPTION\System\CentralProcessor\" . (A_Index-1), ProcessorNameString
if Speed%A_Index% <>
Loop, Parse, Speed%A_Index%,
{
cpuName := A_LoopField
if cpuName is space
spaceCount++
Else
Break
}
StringTrimLeft, Speed%A_Index%, Speed%A_Index%, % spaceCount
speed .= "CPU " A_Index " " Speed%A_Index% . "`n"
Break
}
DriveGet, sysDrive, List, FIXED
Loop, Parse, sysDrive,,
Drives .= "Hard Drive " A_Index " is: " A_LoopField "`n"
ThisProcess := DllCall("GetCurrentProcess")
if !DllCall("IsWow64Process", "uint", ThisProcess, "int*", IsWow64Process)
IsWow64Process := false
osBit := IsWow64Process ? "win64" : "win32"
FileAppend, % "Operating System:`n" A_OSVersion " (" osBit ")`n`nCPU(s):`n" speed "`nHardDrive(s):`n" Drives "`n" ServicePack, % A_Desktop "\Computer Specs.txt"
Msgbox, % "Operating System:`n" A_OSVersion " (" osBit ")`n`nCPU(s):`n" speed "`nHardDrive(s):`n" Drives "`n" ServicePack |
If not can you post the code? I just want to make sure 100% its the same reg keys for W7... _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 19, 2009 10:07 pm Post subject: |
|
|
ok here is the output using ur script
i dont know much about Reg, so yea, just showing what i got from my desktop
 |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 19, 2009 10:09 pm Post subject: |
|
|
| note that i have Vista ultra installed in my other drive, but never use XP on this desktop, so i have no idea where that XP comes from |
|
| Back to top |
|
 |
Eedis
Joined: 12 Jun 2009 Posts: 1158 Location: Indianapolis IN, USA
|
Posted: Thu Nov 19, 2009 11:43 pm Post subject: |
|
|
Why not use Speccy? It's wonderful software I use. It gives detailed information about your system specs and goes into detail of each. Can give you the temperature of your CPU and other stuff down to the nitty gritty. You can find it here. _________________ www.AutoHotkey.net/~Eedis
I love my wife and daughter so much.
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|