Jump to content
Sign in to follow this  
chakka

RunWait() how to suppress child window.

Recommended Posts

chakka

hello AutoIt friends,

I'm executing WinRar.exe via Autoit RunWait() function using the falg @SW_HIDE. but sometimes I may get corrupted rar/zip archive. so when I try to extract these files, "winrar diagnostic messages" window will appear and someone need to close the "error" dialogue box to continue executing remain portion of the script

How can I overcome these error notification dialogue? (but I need to catch the error for logging purpose)

RunWait($rarPath& ' x -o+ "'&$archFile&'" "' & $extractPath&'"',"",@SW_HIDE)

Can you please guide me.

Thanks

Share this post


Link to post
Share on other sites
water

Don't use the version with graphical user interface (WinRAR.exe) use the command line console (text mode) version (Rar.exe).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Or set the flag to disable error messages: -inul


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
stormbreaker

Something like:

$TITLE = "My Error Window Title"
$BUTTONTEXT = "OK"
WinActivate($TITLE, "")
ControlClick($TITLE, "", "[TEXT:" & $BUTTONTEXT & "]")
Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites
chakka

thanks all

@water. -INUL is ok but i need to catch the error

is it possible something like

RunWait($rarPath& ' x -o+ "'&$archFile&'" "' & $extractPath&'"',"",@SW_HIDE)
If $error Then ; write to log file

Share this post


Link to post
Share on other sites
water

Please have a look at the help file, function RunWait:

Return Value

Success: Returns the exit code of the program that was run.

So if WinRAR gives you a different return value when there was a problem then you can catch it. But you need to test.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Or use flag -ilog to write the error messages to a log file. You can then check the log for errors in your AutoIt script.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
chakka

thanks a bunch water. I'm testing... most probably I'll conclude with -ilog.

see you again

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  

×