Jump to content

Gather basic computer information tidily?


Altecice
 Share

Recommended Posts

hello, its me again :).

Thanks for all your help with my script on my last post, I got it working!.

Trouble I am having now is, I have my script gathering information about the computer and saving it

to the default location as "report.txt". Now It work all fine and well but its very messy:

;-----------------part two. - Creates report and saves it - --------------
;Opens System Information, waits 10 seconds and selects all and copys to clipboard.
Send("#r")
WinWaitActive("Run")
Send("msinfo32{Enter}")
WinWaitActive("[CLASS:SysListView32", "", 10)
Send("^a")
Send("^c")
ProcessClose("HelpCtr.exe")
;Opens notepad, pastes clipboard,closes and saves file to desktop as "report.txt"
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("^v")
Send("!f")
Send("x")
WinWaitActive("Notepad")
Send("y")
Send("report.txt")
Send("{ENTER}")
WinWaitClose("Untitled - Notepad")
;Opens an inputbox asking for part number, reopens report.txt, moves data down 2 lines
;adds three titles, pastes the input box data.
$Input = InputBox("What is the part number?", "Please Enter the Part Number of the laptop you are working on.", "(Part Number here!)")
ShellExecute("C:Documents and SettingsuserMy Documentsreport.txt")
WinWaitActive("report - Notepad")
Send("{ENTER}")
Send("{ENTER}")
Send("{UP}")
Send("{UP}")
send("----------------- Spec Report----------------- ")
Send("{ENTER}")
send("http://www.cheaper-laptops.co.uk/")
Send("{ENTER}")
Send("Part Number:")
ControlSend("report", "", "Edit1", $Input)
Send("{ENTER}")
;============part two end===========

I currently use MSINFO32 and ctr+A and copy and paste to gather the information but when its put on the notepad its not very tidy and hard to read. So my question is.

Is there some other "cleaner" method to gathering basic information about the computer?

Ohh and one last thing how can I go about finding and reporting the hard drive size, MSINFO32/DXDIAG don't report hard drive sizes ;)

Worth a note that all these computers will be running Windows Xp Pro.

Thank you in advance.

EDIT: output of my script

OS Name Microsoft Windows 7 Ultimate
Version 6.1.7601 Service Pack 1 Build 7601
Other OS Description  Not Available
OS Manufacturer Microsoft Corporation
System Name 
System Manufacturer System manufacturer
System Model System Product Name
System Type x64-based PC
Processor Intel(R) Core(TM) i7 CPU       960  @ 3.20GHz, 4012 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. 1102, 23/09/2010
SMBIOS Version 2.5
Windows Directory C:Windows
System Directory C:\Windows\System32\
Boot Device DeviceHarddiskVolume2
Locale United Kingdom
Hardware Abstraction Layer Version = "6.1.7601.17514"
User Name Andrews-PCAndrew
Time Zone GMT Standard Time
Installed Physical Memory (RAM) 12.0 GB
Total Physical Memory 12.0 GB
Available Physical Memory 9.14 GB
Total Virtual Memory 24.0 GB
Available Virtual Memory 20.9 GB
Page File Space 12.0 GB
Page File X:pagefile.sys
Edited by Altecice
Link to comment
Share on other sites

You could give " a try. It uses WMI to query all kind of system information. If you use "HTML" as output option it's easy to format the output using CSS.

Use WMI Class "Win32_DiskPartition" to find the harddrive size.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thanks for your suggestion Water but unfortunetly i have only been using AutoIt for two days and i have no idea how to use that :).

I think i have solved one problem but hit another, I am getting DXDIAG to save a report but it contains too much data! I don't need all the data, Is there some way i can parse some date out of a .txt file and have it placed on another one?

For example.

------------------
System Information
------------------
Time of this report: 2/18/2012, 18:08:22
       Machine name: ANDREWS-PC
   Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
           Language: English (Regional Setting: English)
System Manufacturer: System manufacturer
       System Model: System Product Name
               BIOS: BIOS Date: 09/23/10 21:00:01 Ver: 08.00.15
          Processor: Intel(R) Core(TM) i7 CPU        960  @ 3.20GHz (8 CPUs), ~3.9GHz
             Memory: 12288MB RAM
Available OS Memory: 12280MB RAM
          Page File: 3340MB used, 21216MB available
        Windows Dir: C:Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 32bit Unicode

Is there someway i can get just

------------------
System Information
------------------
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
Processor: Intel(R) Core(TM) i7 CPU      960  @ 3.20GHz (8 CPUs), ~3.9GHz
             Memory: 12288MB RAM

and have that saved so i can copy all the data to a new txt file ?

Thank you

Edited by Altecice
Link to comment
Share on other sites

Thanks for your suggestion Water but unfortunetly i have only been using AutoIt for two days and i have no idea how to use that :).

I think i have solved one problem but hit another, I am getting DXDIAG to save a report but it contains too much data! I don't need all the data, Is there some way i can parse some date out of a .txt file and have it placed on another one?

For example.

------------------
System Information
------------------
Time of this report: 2/18/2012, 18:08:22
       Machine name: ANDREWS-PC
   Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
           Language: English (Regional Setting: English)
System Manufacturer: System manufacturer
       System Model: System Product Name
               BIOS: BIOS Date: 09/23/10 21:00:01 Ver: 08.00.15
          Processor: Intel(R) Core(TM) i7 CPU        960  @ 3.20GHz (8 CPUs), ~3.9GHz
             Memory: 12288MB RAM
Available OS Memory: 12280MB RAM
          Page File: 3340MB used, 21216MB available
        Windows Dir: C:Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 32bit Unicode

Is there someway i can get just

------------------
System Information
------------------
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
Processor: Intel(R) Core(TM) i7 CPU      960  @ 3.20GHz (8 CPUs), ~3.9GHz
             Memory: 12288MB RAM

and have that saved so i can copy all the data to a new txt file ?

Thank you

Here, this code will help you break down the information.

$Text = FileRead(@ScriptDir&"Report.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Operating System:(.*?)"&@CRLF&".*?Processor:(.*?)"&@CRLF&".*?Memory:(.*?)"&@CRLF,1)
$NewFileHen = FileOpen(@ScriptDir&"NewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"System Information"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[2])
FileClose($NewFileHen)
Link to comment
Share on other sites

Gah changed it for my use and for some reason i keep getting an error on line 5 :)

Error:Subscript used with non-Array Variable.

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Processor: (.*?)"&@CRLF&".*Operating System: .*?)"&@CRLF&".*Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"System Information"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[2]&@CRLF)
FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
FileClose($NewFileHen)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*Current Mode: (.*?)"&@CRLF&".*Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
FileClose($NewFileHen)

EDIT: Got it working but its reporting Memory: 0. when it shouldn't be.

Edited by Altecice
Link to comment
Share on other sites

Gah changed it for my use and for some reason i keep getting an error on line 5 :)

Error:Subscript used with non-Array Variable.

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Processor: (.*?)"&@CRLF&".*Operating System: .*?)"&@CRLF&".*Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"System Information"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[2]&@CRLF)
FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
FileClose($NewFileHen)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*Current Mode: (.*?)"&@CRLF&".*Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
FileClose($NewFileHen)

I have double checked what i think could be wrong, but i have no idea ;)... Worth to note it was working before i added "time of this report: " into the first section. The second section when run on its own works .

See if this works.

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt") ; Here give the location of the report file.
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*?Current Mode: (.*?)"&@CRLF&".*?Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1) ; Here Give the location of the New file
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
FileClose($NewFileHen)
Link to comment
Share on other sites

EDIT: Got it working but its reporting Memory: 0. when it shouldn't be.

Is the report showing Memory is 0 or the break down function.

Edited by Guest
Link to comment
Share on other sites

The report is showing.

------------------
Display Devices
------------------

Time of this report: 2/18/2012, 21:06:56
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
Processor: Intel(R) Core(TM) i7 CPU      960  @ 3.20GHz (8 CPUs), ~3.9GHz
Memory: 0


------------------
Display Devices
------------------

Dedicated Memory: 1503 MB
Current Mode: 1920 x 1080 (32 bit) (60Hz)
Monitor Model: VH226

So i guess.. Its showing 0?

(I know its not showing "Card Name:". that's my fault its fixed now but still reporting 0 ram ;)

code as it is now:

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Operating System: (.*?)"&@CRLF&".*Processor: (.*?)"&@CRLF&".*Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
   FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
      FileClose($NewFileHen)

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*Current Mode: (.*?)"&@CRLF&".*Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)

Thank you for all your help by the way :).

Edited by Altecice
Link to comment
Share on other sites

The report is showing.

------------------
Display Devices
------------------

Time of this report: 2/18/2012, 21:06:56
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.110622-1506)
Processor: Intel(R) Core(TM) i7 CPU      960  @ 3.20GHz (8 CPUs), ~3.9GHz
Memory: 0


------------------
Display Devices
------------------

Dedicated Memory: 1503 MB
Current Mode: 1920 x 1080 (32 bit) (60Hz)
Monitor Model: VH226

So i guess.. Its showing 0?

Yes the actual report is showing 0. :)
Link to comment
Share on other sites

You have made a mistake in the break down function this is how it shoud be.

.*?Memory: (.*?) Not this: .*Memory: (.*?)

Edited by Guest
Link to comment
Share on other sites

Ok well i got my script working. I was about to make it in .EXE and i got some error and it deleted my file!!!!

So i lost the vast majority of my work :) is this some sort of bug?

Im now back to the error i had before Error:Subscript used with non-Array Variable.

Send("#r")
WinWaitActive("Run")
Send("dxdiag{Enter}")
WinWaitActive("DirectX Diagnostic Tool")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{Enter}")
WinWaitActive("Save As")
Send("{Enter}")

$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Operating System: (.*?)"&@CRLF&".*?Processor: (.*?)"&@CRLF&".*?Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*?Current Mode: (.*?)"&@CRLF&".*?Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)

(Posting my code in case it decided to delete its self again

Edited by Altecice
Link to comment
Share on other sites

Yeah my file was open i think that may have been the problem but its ok i have it all up and working again.

Send("#r")
WinWaitActive("Run")
Send("dxdiag{Enter}")
WinWaitActive("DirectX Diagnostic Tool")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{Enter}")
WinWaitActive("Save As")
Send("{Enter}")
Sleep(1500)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Operating System: (.*?)"&@CRLF&".*?Processor: (.*?)"&@CRLF&".*?Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*?Current Mode: (.*?)"&@CRLF&".*?Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)
  
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Drive: C(.*?)"&@CRLF&".*?Free Space: (.*?)"&@CRLF&".*?Total Space: (.*?)"&@CRLF&".*?Model: (.*?)"&@CRLF&".*?Drive: E(.*?)"&@CRLF&".*?Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"HardDisk & DVD/CD-ROM Drives"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Drive: C"&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Free Space: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Total Space: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Model: "&$ReportArrayDATA[3]&@CRLF)
   FileWrite($NewFileHen," "&@CRLF)
      FileWrite($NewFileHen,"Drive: E"&$ReportArrayDATA[4]&@CRLF)
      FileWrite($NewFileHen,"Model: "&$ReportArrayDATA[5]&@CRLF)
      FileClose($NewFileHen)
Link to comment
Share on other sites

Yeah my file was open i think that may have been the problem but its ok i have it all up and working again.

Send("#r")
WinWaitActive("Run")
Send("dxdiag{Enter}")
WinWaitActive("DirectX Diagnostic Tool")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{Enter}")
WinWaitActive("Save As")
Send("{Enter}")
Sleep(1500)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Time of this report: (.*?)"&@CRLF&".*?Operating System: (.*?)"&@CRLF&".*?Processor: (.*?)"&@CRLF&".*?Memory: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Time of this report: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Operating System: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Processor: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Memory: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Card name: (.*?)"&@CRLF&".*?Dedicated Memory: (.*?)"&@CRLF&".*?Current Mode: (.*?)"&@CRLF&".*?Monitor Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"Display Devices"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Card name: "&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Dedicated Memory: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Current Mode: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Monitor Model: "&$ReportArrayDATA[3]&@CRLF)
   FileClose($NewFileHen)
  
$Text = FileRead("X:UsersAndrewDocumentsDxDiag.txt")
$ReportArrayDATA = StringRegExp($Text,"(?i)(?s)Drive: C(.*?)"&@CRLF&".*?Free Space: (.*?)"&@CRLF&".*?Total Space: (.*?)"&@CRLF&".*?Model: (.*?)"&@CRLF&".*?Drive: E(.*?)"&@CRLF&".*?Model: (.*?)"&@CRLF,1)
$NewFileHen = FileOpen("X:UsersAndrewDocumentsNewFile System Info.txt", 1)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"------------------"&@CRLF&"HardDisk & DVD/CD-ROM Drives"&@CRLF&"------------------"&@CRLF)
FileWrite($NewFileHen," "&@CRLF)
FileWrite($NewFileHen,"Drive: C"&$ReportArrayDATA[0]&@CRLF)
   FileWrite($NewFileHen,"Free Space: "&$ReportArrayDATA[1]&@CRLF)
   FileWrite($NewFileHen,"Total Space: "&$ReportArrayDATA[2]&@CRLF)
   FileWrite($NewFileHen,"Model: "&$ReportArrayDATA[3]&@CRLF)
   FileWrite($NewFileHen," "&@CRLF)
      FileWrite($NewFileHen,"Drive: E"&$ReportArrayDATA[4]&@CRLF)
      FileWrite($NewFileHen,"Model: "&$ReportArrayDATA[5]&@CRLF)
      FileClose($NewFileHen)

even if your file is open it should not be deleted, i guess it was a bug.

Well at least you got it working again. Well done! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...