Jump to content

need help about the run function


Jeffel
 Share

Recommended Posts

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 )

Link to comment
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=

Link to comment
Share on other sites

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
Link to comment
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)

Link to comment
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 !

Link to comment
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)

Link to comment
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 !

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

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