Jump to content

Get Direct X version, & Get Cpu speed ?


Recommended Posts

Runwait("dxdiag.exe /t dx.tmp /whql:off" , @tempdir )
FileOpen ( $file, 0 )
If $file = -1 Then Exit

$cpu = FileReadLine ( $file , 11 );line to read the cpu info
$dxv = FileReadLine ( $file , 15 );line to read the DirectX info
$ddi = FileReadLine ( $file , 54 );line to read the DDI info
FileClose( $file )
;FileDelete ( $file )

MsgBox(0, "CPU", $cpu )
MsgBox(0, "DirectX-Version", $dxv )
MsgBox(0, "DDI-Version", $ddi )

Is this want u want?

Link to comment
Share on other sites

Sorry, i forget the vars:

Dim $file = @tempdir & "\dx.tmp", $cpu, $dxv, $ddi
Runwait("dxdiag.exe /t dx.tmp /whql:off" , @tempdir )
FileOpen ( $file, 0 )
If $file = -1 Then Exit

$cpu = FileReadLine ( $file , 11 );line to read the cpu info
$dxv = FileReadLine ( $file , 15 );line to read the DirectX info
$ddi = FileReadLine ( $file , 54 );line to read the DDI info
FileClose( $file )
;FileDelete ( $file )

MsgBox(0, "CPU", $cpu )
MsgBox(0, "DirectX-Version", $dxv )
MsgBox(0, "DDI-Version", $ddi )

Edited by Westi
Link to comment
Share on other sites

Ok I got this to work

Runwait("dxdiag.exe /t dxtest.txt", @tempdir )
Dim $file = (@tempdir & "\dxtest.txt")
FileOpen ( $file, 0 )
If $file = -1 Then Exit

$cpu = FileReadLine ( $file , 11 );line to read the cpu info
$dxv = FileReadLine ( $file , 15 );line to read the DirectX info
$ddi = FileReadLine ( $file , 54 );line to read the DDI info

;FileDelete ( $file )

MsgBox(0, "CPU", $cpu )
MsgBox(0, "DirectX-Version", $dxv )
MsgBox(0, "DDI-Version", $ddi )

seems it didnt like the whql part

Link to comment
Share on other sites

Ok, i wrote it very fast.

Here is a working script, sorry. :">

Dim $file = @tempdir & "\dx.tmp", $cpu, $dxv
SplashTextOn("DX-Diag", " Please wait while processing...", 280, 30, -1, -1, 4, "", 14)
Runwait("dxdiag.exe /t dx.tmp /whql:off" , @tempdir )
If FileExists ( $file ) then
FileOpen ( $file, 0 )
If $file = -1 Then Exit
$cpu = FileReadLine ( $file , 11 );line to read the cpu info
$dxv = FileReadLine ( $file , 15 );line to read the DirectX info
$ddi = FileReadLine ( $file , 54 );line to read the DDI info
;Check the right line in the dxd.tmp

FileClose( $file )
SplashOff()
MsgBox(0, "CPU", $cpu )
MsgBox(0, "DirectX-Version", $dxv )
MsgBox(0, "DDI-Version", $ddi )
MsgBox(0, "Whole textfile is in:", $file )
else
    MsgBox(4096,"Error", $file & " does not exist.")
EndIf
For more information about dxdiag, type "dxdiag /?" in a console window.
Link to comment
Share on other sites

I found the problem, the whql needs to come before the file write

SO

Runwait("dxdiag.exe /whql:off /t dx.tmp" , @tempdir )

instead of

Runwait("dxdiag.exe /t dx.tmp /whql:off" , @tempdir )

Thanks for the help though, its apreciated and all working now :(

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...