chakka Posted October 20, 2012 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted October 20, 2012 Developers Share 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. Link to comment Share on other sites More sharing options...
water Posted October 20, 2012 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted October 20, 2012 Share Posted October 20, 2012 Or set the flag to disable error messages: -inul My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stormbreaker Posted October 20, 2012 Share 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 Link to comment Share on other sites More sharing options...
chakka Posted October 20, 2012 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted October 20, 2012 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted October 20, 2012 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
chakka Posted October 20, 2012 Author Share Posted October 20, 2012 thanks a bunch water. I'm testing... most probably I'll conclude with -ilog.see you again 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