Sign in to follow this  
Followers 0
Its_me_again

"around a variable

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



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


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Hmm, that should return unrar.exe x "C:\Documents and Settings\Administrator\Bureaublad\rar.rar", right? But somehow it doesn't :s

Share this post


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


[center]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.[/center]

Share this post


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

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


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

Share this post


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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

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
Sign in to follow this  
Followers 0