Jump to content

(Solved) Running WinRAR from AutoIt


Recommended Posts

Yes, I am going to feel really stupid after I find out why it don't work...

Running Windows 10 Pro, from the command line I enter

          WinRAR a -r- E:\UserID\DataBackup\BackupData.rar D:\UserID\Data\*

It works fine

From my AutoIt script I enter:

          RunWait("WinRAR a -r- E:\UserID\DataBackup\BackupData.rar D:\UserID\Data\*")

It doesn't work. No errors reported, the script finishes running but no file created

If I try using ShellExecuteWait I get multiple popup error messages.

Any guidance or words of wisdom about what I am missing an or doing wrong?

Thanks

Mel

 

Edited by melmitts707
Link to comment
Share on other sites

To run DOS (console) commands, try RunWait(@ComSpec & " /c " & 'commandName', "", @SW_HIDE)    ; don't forget " " before "/c"

Remarks in the Documentation for RunWait

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

The help file is a great ressource ;)
RunWait expects "The full path of the program".

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

 

Link to comment
Share on other sites

You are saying that as if WinRAR is the weird one. In fact most applications DON'T add themselves to the PATH environment variable. Open a cmd window and run path and see for yourself.

Link to comment
Share on other sites

I wasn't saying that WinRAR is weird, I was saying the other compression program (pacl) did not require it so I didn't think about or even try to run the WinRAR program with the full path when I should have. I know most programs must be ran with full path or added to the system PATH command. I just went temporarily brain dead...

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...