filename with spaces and variables

3 posts in this topic


i am new @ autoit. i want to rar some directories. my command is:

Run ("C:\Program Files\WinRAR\Rar.exe a -m0 -v500000k M:\TEMPRAR\"&$rarName&" M:\Mix\"&$dirName&"\*.*")

I got an error, cause rar.exe has problems with the directoryname, the spaces or the variable. the variable "$dirName" is something like M:\Mix\DJ Tiesto 2016 Mix\

I think the problem is, how to set the quotes. i believe i tried all possibilities with no success. 


some ideas how to set quotes??

Share this post

Link to post
Share on other sites

Something like this maybe?:

Run ('C:\Program Files\WinRAR\Rar.exe a -m0 -v500000k "M:\TEMPRAR\' & $rarName & '" "M:\Mix\' & $dirName & '\*.*"')


1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

@noobee88 I always suggest, when working with spaces and quotes, do write it out to the console first and then try it at the command line. So does this output:

ConsoleWrite("C:\Program Files\WinRAR\Rar.exe a -m0 -v500000k M:\TEMPRAR\" & $rarName & " M:\Mix\" & $dirName & "\*.*" & @CRLF)

copied into a command line window, give you what you want?

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

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