Sign in to follow this  
Followers 0
herworth

Run Or Runwait

14 posts in this topic

When I use a variable as a filename eg $file = FileSaveDialog(etc ..) I can't get it to open because I can't get the quotes right.

Runwait('"zipgenius.exe" "example.zip"') is OK but

Runwait("Zipgenius.exe " & $file) is not.

Any thoughts?

Thanks in advance

Peter


[u][font="Arial"]Pete[/font][/u]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Peter,

you can try it this way:

Runwait('Zipgenius.exe "' & $file & '"')

this will put " arround your parameters...

or

Runwait('"Zipgenius.exe ' & $file & '"')

will put " arround the whole command....

Edited by JdeB

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

Try ..

;Nesting (") within (')

Runwait('Zipgenius.exe "' & $file & '"')

;Nesting ("") within (")

Runwait("Zipgenius.exe """ & $file & """")

Share this post


Link to post
Share on other sites

Thanks to both of you. I thought I'd tried every combination of quotes but

Runwait("zip """ & $file & """")
worked.

Peter


[u][font="Arial"]Pete[/font][/u]

Share this post


Link to post
Share on other sites

Run("DCPlusPlus.exe", @ProgramsDir & '"\Xrc Connect\Xrc Connect 6a11"',)

Can anyone tell me why this won't work?


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites

Run("DCPlusPlus.exe", @ProgramsDir & '"\Xrc Connect\Xrc Connect 6a11"',)

Can anyone tell me why this won't work?

<{POST_SNAPBACK}>

The last comma should not be in the function. This will only produce error.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

And if the executable is not in your PATH environment variable, you need to specify the full path.

If NewSettings.reg is in C:\utilities, this will work:

Run('REGEDIT.EXE /S NewSettings.reg', 'C:\utilities')

This won't work without changing the PATH environment variable:

Run('AutoIt3.exe Test.au3', 'C:\Program Files\AutoIt3')

So, to prevent problems it's better to use the full path.

Like this:

Run('C:\Program Files\AutoIt3\AutoIt3.exe Test.au3', 'C:\scripts')

or this:

Run('C:\Program Files\AutoIt3\AutoIt3.exe C:\scripts\Test.au3')
Edited by SlimShady

Share this post


Link to post
Share on other sites

Thank you for replying. Can you fix this to what it should be to give me a solid guide?:

D:\Program Files\Xrc Connect\Xrc Connect 6a11\DCPlusPlus.exe

Thanks in advance


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

RunWait('D:\Program Files\Xrc Connect\Xrc Connect 6a11\DCPlusPlus.exe')

Edited by SlimShady

Share this post


Link to post
Share on other sites

dude you rock. What about the other one then? How would you make Run("DCPlusPlus.exe", @ProgramsDir & '"\Xrc Connect\Xrc Connect 6a11"',) work, if RunWait('D:\Program Files\Xrc Connect\Xrc Connect 6a11\DCPlusPlus.exe', "", @SW_MAXIMIZE) does?

Man I suck at the engleesh langwidch sum tymes.


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites

This is just because I can't sleep.

Run(@ProgramFilesDir & "\Xrc Connect\Xrc Connect 6a11\DCPlusPlus.exe")

Now learn the AutoIt language or get the f___ outta here.

Share this post


Link to post
Share on other sites

This is just because I can't sleep.

Run(@ProgramFilesDir & "\Xrc Connect\Xrc Connect 6a11\DCPlusPlus.exe")

Now learn the AutoIt language or get the f___ outta here.

<{POST_SNAPBACK}>

What do you think you have been helping me do? :D:D

Before I have ever asked a question I have read the help file and tried to do it on my own. Dude if you don't want to help then please don't! Only happy helpers need apply! :)


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites

Run("DCPlusPlus.exe", @ProgramsDir & '"\Xrc Connect\Xrc Connect 6a11"') 

Forget the working directory, for now. Does Run("DCPlusPlus.exe") work ? Unless it is in the same directory, or a system path, like system32 folder, then it will fail. Same as running a command from a dos box or run window. But if you give a full address to it's whereabouts, then it will work. But another problem maybe that it will execute through Run(), but the executable may need a working folder, to see the support files, that it will work with. So then, a working directory is added.

What does this mean?

The Working Directory parameter in Run(), is NO substitute for the full address being needed.

Share this post


Link to post
Share on other sites

Thank you as well MHZ.


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

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