Jump to content

filename with spaces and variables


noobee88
 Share

Recommended Posts

hello@community,

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??

Link to comment
Share on other sites

  • Developers

Something like this maybe?:

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

Jos

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

  • Moderators

@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?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...