chakka Posted October 20, 2012 Posted October 20, 2012 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 scriptHow 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
Developers Jos Posted October 20, 2012 Developers Posted October 20, 2012 Have you looked at the commandline parameters for winrar to suppress error messages? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
water Posted October 20, 2012 Posted October 20, 2012 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 2024-07-28 - Version 1.6.3.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 (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
water Posted October 20, 2012 Posted October 20, 2012 Or set the flag to disable error messages: -inul My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
stormbreaker Posted October 20, 2012 Posted October 20, 2012 (edited) Something like: $TITLE = "My Error Window Title" $BUTTONTEXT = "OK" WinActivate($TITLE, "") ControlClick($TITLE, "", "[TEXT:" & $BUTTONTEXT & "]") Edited October 20, 2012 by MKISH ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
chakka Posted October 20, 2012 Author Posted October 20, 2012 thanks all@water. -INUL is ok but i need to catch the erroris it possible something likeRunWait($rarPath& ' x -o+ "'&$archFile&'" "' & $extractPath&'"',"",@SW_HIDE) If $error Then ; write to log file
water Posted October 20, 2012 Posted October 20, 2012 Please have a look at the help file, function RunWait:Return ValueSuccess: 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 2024-07-28 - Version 1.6.3.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 (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
water Posted October 20, 2012 Posted October 20, 2012 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 2024-07-28 - Version 1.6.3.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 (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
chakka Posted October 20, 2012 Author Posted October 20, 2012 thanks a bunch water. I'm testing... most probably I'll conclude with -ilog.see you again
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