Sign in to follow this  
Followers 0
Jeffel

need help about the run function

11 posts in this topic

Hi all !

I have a litlle problem with my script.

I would like to run an exe named :

F4-BMS Config Editor.exe in a directory, but in the same directory a have another exe named F4-BMS.exe.

When i ask to run "F4-BMS Config Editor.exe" autoIt run the " F4-BMS.exe"...

How can i solve the problem ?

Thanx for your reply!

(Sorry for my English , i'am french )

Share this post


Link to post
Share on other sites



Same way you'd do it from the command line:

Run('"F4-BMS Config Editor.exe"')

Share this post


Link to post
Share on other sites

Thanx mate i'll test this !

Share this post


Link to post
Share on other sites

Also, make sure that you fully qualify the path where your exe is located. Something like:

Run( "C:\Program Files\Appname\F4-BMS Config Editor.exe" )

Where:

"C:\Program Files\Appname" is the directory where your exe is located.

=MX=

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Not running !

My script is :

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")

run($reg &"\" &"F4-BMS Config Editor.exe")

In fact instead of running run($reg &"\" &"F4-BMS Config Editor.exe") autoIt run this : run($reg &"\" &"F4-BMS.exe")

Why ?

How can i make autoIT run the good exe ?

Edited by Jeffel

Share this post


Link to post
Share on other sites

Should be something along the following lines...

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")
$exe="F4-BMS Config Editor.exe"
Run('"' & $reg & '\' & $exe & '"')

Let me know if that works for you,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Should be something along the following lines...

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")
$exe="F4-BMS Config Editor.exe"
Run('"' & $reg & '\' & $exe & '"')

Let me know if that works for you,

JS

<{POST_SNAPBACK}>

Very Good JSThePatriot, yes that's works for me !

By the way i don't know how to build such a syntax, i haven't seen this in the help file !

Thanx a lot !

Share this post


Link to post
Share on other sites

Everyone suggested to me to look at FAQ 9 it really didnt help but if you check out the follow thread that I just posted and learned this from you may be able to figure it out like I did.

http://www.autoitscript.com/forum/index.php?showtopic=5419

Hope it helps,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

This one is matching too :

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")

run('"'&$reg &"\" &"F4-BMS Config Editor.exe" &'"')

or without the last &'"'

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")

run('"'&$reg &"\" &"F4-BMS Config Editor.exe")

Really i can't understand why the '"' is necessary in the syntax, if somebody can explain it to me, i'll be happy...

Is it necessary to put the &'"' at the end , it is working without it ?...

Thanx for your reply !

Share this post


Link to post
Share on other sites

This one is matching too :

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")

run('"'&$reg &"\" &"F4-BMS Config Editor.exe" &'"')

or without the last &'"'

$reg=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MicroProse\Falcon\4.0" , "baseDir")

run('"'&$reg &"\" &"F4-BMS Config Editor.exe")

Really i can't understand why the '"' is necessary in the syntax, if somebody can explain it to me, i'll be happy...

Is it necessary to put the &'"' at the end , it is working without it ?...

Thanx for your reply !

<{POST_SNAPBACK}>

The characters you are refering to are ' " ' which means that you want to close the string you are currently building. Normally run line applications will assume that you want a " there is you dont close it yourself so I dont think it is required but it is suggested as if anyone else ever reads your code they will be lost trying to find where your string ends.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

ok Matt !

Thanx !

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