Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

SysInfo


  • Please log in to reply
4 replies to this topic
dinkosta
  • Members
  • 39 posts
  • Last active: Dec 19 2008 07:25 PM
  • Joined: 28 Sep 2005
This is a small utility to get some basic information about a system. The button 'Registry Run items' creates a text file with 'Run' entries found under HKLM. The 'Installed software' button creates a text file with entries found under 'HKLM\...\Uninstall'.
Modifications, improvements are welcome. I'd like to include more system info, so if somebody knows how to reliably retrieve information about installed printers, graphic card, processor speed etc. on all OS's (Win 98, XP etc.) ...
;;; Author: Kostic Dejan 
;;; OS: Windows 98SE 
;;; AHK Version: 1.0.37.04 
;;; Date: 12.01.2006 

FormatTime, dat,,dd.MM.yyyy
FormatTime, vrem,A_now,HH:mm

RegRead,tif,HKCU,Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders,Cache   ;get TIF folder

FileSelectFolder, folder, , 3, Select a drive to analyze: 
if folder = 
   return 
DriveGet, list, list                           ;example code from help file
DriveGet, cap, capacity, %folder% 
DrivespaceFree, free, %folder% 
DriveGet, fs, fs, %folder% 
DriveGet, label, label, %folder% 
DriveGet, serial, serial, %folder% 
DriveGet, type, type, %folder% 
DriveGet, status, status, %folder% 
     
statString:=MemGetStats() 
StringSplit, stats, statString, | 
     
Gui,font,s9
Gui, Add, ListView, vDriveInfoListView x10 w410 r32, Data|Value
     LV_Add("","Date:",dat)
     LV_Add("","Time:",vrem)
     LV_Add("","OS:",a_osversion)
     LV_Add("","User name:",a_username)
     LV_Add("","Computer name:",a_computername)
     LV_Add("","Windows folder:",a_windir)
     LV_Add("","Desktop folder:",a_desktop)
     LV_Add("","Start menu folder:",a_startmenu)
     LV_Add("","Startup folder:",a_startup)
     LV_Add("","Temp folder:",temp)
     LV_Add("","Programs folder:",a_programfiles)
     LV_Add("","My documents:",a_mydocuments)
     LV_Add("","Temporary Internet folder:",tif)
     LV_Add("","IP address:",a_ipaddress1)
     LV_Add("","Desktop Width:",a_screenwidth)
     LV_Add("","Desktop Height:",a_screenheight)
     LV_Add("","All drives:",list)
     LV_Add("","Selected drive:",folder)
     LV_Add("","Drive type:",type)
     LV_Add("","Drive Status:",status)
     LV_Add("","Total capacity (MB):",cap)
     LV_Add("","Free space (MB):",free)
     LV_Add("","File system:",fs)
     LV_Add("","Volume label:",label)
     LV_Add("","Serial number:",serial)
     LV_Add("","Memory load (in %):",stats1)
     LV_Add("","Total physical Ram:",stats2)
     LV_Add("","Available physical Ram:",stats3)
     LV_Add("","Total Pagefile:",stats4)
     LV_Add("","Available Pagefile:",stats5)
     LV_Add("","Total Virtual:",stats6)
     LV_Add("","Available Virtual:",stats7)
     LV_ModifyCol(1,"130")
     LV_ModifyCol(2,"Autohdr")
Gui,add,button,x10 w110 grunit,Registry Run items
Gui,add,button,x130 yp w100 ginsw,Installed Software
Gui,add,button,x360 yp w50,E&xit
Gui,show
return 

MemGetStats()                    ; code posted by antonyb
{ 
  VarSetCapacity(memorystatus, 4+4+4+4+4+4+4+4) 
  success := DllCall("kernel32.dll\GlobalMemoryStatus", "uint", &memorystatus) 
  stats := ReadInteger(&memorystatus,4,4, false)                          ; Memory Load (Percentage of memory in use) 
  stats := stats "|" Round(ReadInteger(&memorystatus,8,4, false)/1024)    ; Total Physical Ram 
  stats := stats "|" Round(ReadInteger(&memorystatus,12,4, false)/1024)   ; Available Physical Ram 
  stats := stats "|" Round(ReadInteger(&memorystatus,16,4, false)/1024)   ; Total Pagefile 
  stats := stats "|" Round(ReadInteger(&memorystatus,20,4, false)/1024)   ; Available Pagefile 
  stats := stats "|" Round(ReadInteger(&memorystatus,24,4, false)/1024)   ; Total Virtual 
  stats := stats "|" Round(ReadInteger(&memorystatus,28,4, false)/1024)   ; Available Virtual 
  return stats 
} 

ReadInteger( p_address, p_offset, p_size, p_hex=true ) 
{ 
  value = 0 
  old_FormatInteger := a_FormatInteger 
  if ( p_hex ) 
    SetFormat, integer, hex 
  else 
    SetFormat, integer, dec 
  loop, %p_size% 
    value := value+( *( ( p_address+p_offset )+( a_Index-1 ) ) << ( 8* ( a_Index-1 ) ) ) 
  SetFormat, integer, %old_FormatInteger% 
  return, value 
} 

runit:                  ;get Run entries from registry
fileappend,HKLM\Software\Microsoft\Windows\CurrentVersion\Run`n`n,run items.txt
Loop,HKLM, Software\Microsoft\Windows\CurrentVersion\Run,1,1
  {
   RegRead, RegValue
   if ErrorLevel <> 0
   return
   fileappend,Name = %A_LoopRegName%`nValue = %RegValue%`n`n,run items.txt
  }
return

insw:                   ;get installed software
fileappend,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall`n`t~~~~~~~~~~`n`n,installed software.txt
  Loop, HKLM, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, 1, 1 
  {
   if a_loopregname = DisplayName
   {
   regread,regvalue
   fileappend, %A_LoopRegSubKey%`nDisplayName = %RegValue%`n`n, installed software.txt
  } 
 }
return

GuiClose:
ButtonExit: 
ExitApp


Veovis
  • Members
  • 389 posts
  • Last active: Mar 17 2009 12:24 AM
  • Joined: 13 Feb 2006
very nice, i like the guis!
thats a lot of good information

you might be able to look in the 'printers and faxes' folder on a computer (but i think thats an XP things perhaps)

For hardware info...well thats what device manager is for.

But nice work!
Posted Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."

dinkosta
  • Members
  • 39 posts
  • Last active: Dec 19 2008 07:25 PM
  • Joined: 28 Sep 2005
Thanks for the feedback, Veovis.
BTW, isn't it funny we both posted scripts with similar title at almost the same time?!

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear dinkosta,
I tried you util & its nice :)

Regards :)


LV_Add("", "Start meni folder:", a_startmenu)


kWo4Lk1.png

dinkosta
  • Members
  • 39 posts
  • Last active: Dec 19 2008 07:25 PM
  • Joined: 28 Sep 2005
Hi goyyah,
thanks for the feedback and for pointing out the typo. I've fixed it.