melmitts707

(Solved) Running WinRAR from AutoIt

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I said I would feel stupid... I was using a different file compression program that didn't require the full path but apparently WinRAR does. Anyway, it works perfectly by including the program's full path.

Thanks to all for the help

Mel

Share this post


Link to post
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.

Share this post


Link to post
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...

 

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