Jump to content

"around a variable


Recommended Posts

Hi, I've made a GUI to extract rar-archves using UnRAR.exe, this is a commandline program to extract rar's. Anyways I'm running it like this: Run("unrar.exe x " & $file, "", @SW_HIDE) and it works fine when $file = C:\folder\rar.rar, but when $file = C:\folder with spaces\rar.rar it doesn't works anymore, it needs " then. So the line would be: UnRAR.exe x "C:\folder with spaces\rar.rar", what I wanna know is how I get those " around my var $file.

Thanks in advance.

Link to comment
Share on other sites

  • Moderators

'"' & $file & '"' is that what your asking?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Well, you could always test that theory like this:

$file = "C:\Documents and Settings\Administrator\Bureaublad\rar.rar"
MsgBox(0, "Test", '"' & $file & '"')

But onto your code... if you don't mind me asking (keep in mind I think I suck at Run commands, so this is an attempt to help at best)... is the 'x' the drive?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well, you could always test that theory like this:

$file = "C:\Documents and Settings\Administrator\Bureaublad\rar.rar"
MsgBox(0, "Test", '"' & $file & '"')

But onto your code... if you don't mind me asking (keep in mind I think I suck at Run commands, so this is an attempt to help at best)... is the 'x' the drive?

No x is a command "x Extract files with full path", but what you said before does works, sorry. made a mistake somewhere else, thanks for the help. :P
Link to comment
Share on other sites

  • Moderators

Good Deal! , because I was butchering it here just trying to figure it out without the program :P.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Good Deal! , because I was butchering it here just trying to figure it out without the program :P.

I tested it like this:

$file = "C:\Documents and Settings\Administrator\Bureaublad\rar.rar"
Run("unrar.exe x " & '"' & $file & '"', "", @SW_HIDE)

And it works, but I still can't find the mistake in the GUI...

Link to comment
Share on other sites

I tested it like this:

$file = "C:\Documents and Settings\Administrator\Bureaublad\rar.rar"
Run("unrar.exe x " & '"' & $file & '"', "", @SW_HIDE)

And it works, but I still can't find the mistake in the GUI...

You are going to have to post your GUI code if you want someone to help with it.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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