igorm Posted August 21, 2008 Share Posted August 21, 2008 Hi, I'm trying to read percentage from console window of makecab for updating my progress bar, but I'm having problems with it. I'm using following code but it wont work. I can get text return from console but I can't extract percentage numbers. #include <Constants.au3> $progressbar2 = ProgressOn("Test", "Please wait") $runcheck=Run(""""&@SystemDir&"\makecab.exe"&""""&" /f ""D:\offxp\OFFICE1.ddf""", "D:\offxp", "", $STDOUT_CHILD) While ProcessExists($runcheck) $readtextfromconsole = StdoutRead($runcheck) If (StringRegExp($readtextfromconsole, "%", 0)=1) And Not ($readtextfromconsole="") Then $percentis = StringMid($readtextfromconsole, 1, 4) ProgressSet($progressbar2, Round($percentis)) MsgBox(0, $percentis, $readtextfromconsole);I check it with this and it never returns what I want EndIf Sleep(10) WEnd Can somebody help me with this? Here is a screen shot of console window: Thanks in advance for any help. Cheers Office 2000/XP/2003/2007 Slipstreamer Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 21, 2008 Share Posted August 21, 2008 Hi, I'm trying to read percentage from console window of makecab for updating my progress bar, but I'm having problems with it. I'm using following code but it wont work. I can get text return from console but I can't extract percentage numbers. #include <Constants.au3> $progressbar2 = ProgressOn("Test", "Please wait") $runcheck=Run(""""&@SystemDir&"\makecab.exe"&""""&" /f ""D:\offxp\OFFICE1.ddf""", "D:\offxp", "", $STDOUT_CHILD) While ProcessExists($runcheck) $readtextfromconsole = StdoutRead($runcheck) If (StringRegExp($readtextfromconsole, "%", 0)=1) And Not ($readtextfromconsole="") Then $percentis = StringMid($readtextfromconsole, 1, 4) ProgressSet($progressbar2, Round($percentis)) MsgBox(0, $percentis, $readtextfromconsole);I check it with this and it never returns what I want EndIf Sleep(10) WEnd Can somebody help me with this? Here is a screen shot of console window: Thanks in advance for any help. Cheers StringMid() returns at string, not surprisingly. Convert it to a number before using it: $percentis = Number(StringMid($readtextfromconsole, 1, 4)) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
igorm Posted August 21, 2008 Author Share Posted August 21, 2008 OK, thanks for reply, but I already found other solution. Cheers Office 2000/XP/2003/2007 Slipstreamer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now