Sign in to follow this  
Followers 0
L3G3NdKillEr

StdOutread

3 posts in this topic

#1 ·  Posted (edited)

hi,

I want my script to read only particular string from a lengthy output..

#include <Constants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $cmd = Run(@comspec & " /c diskid32 /d", @SystemDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
Local $ResponseText

$nOffset = 1
While 1
        $ResponseText &= StdoutRead($Cmd)
    If @error Then ExitLoop
    $array = StringRegExp($ResponseText, 'Drive Serial Num(".*?")', 0, $nOffset)

    If @error = 0 Then
        $nOffset = @extended
        msgbox(0, "Drive Serial Number is- ", $array)
    Else
        ExitLoop
    EndIf
WEnd

i am using this and it returns 0 in a msgbox()

post-24728-12509353713214_thumb.jpg

Edited by L3G3NdKillEr

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Share this post


Link to post
Share on other sites



Its for only retrieving hard drive serial number,

actually iam making it for win9x.. =]


i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Share this post


Link to post
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
Sign in to follow this  
Followers 0