Jump to content

run and Variables


Guest zipee
 Share

Recommended Posts

Ok, Zipee wants to know if you can add variables to the run command, or not... it shouldnt matter the rest of his code, such as, $var2 = "blah.exe" will run($blah.exe) work...

Link to comment
Share on other sites

$var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MindArk\Project Entropia", "")

$var2 = $var1 & "\ClientLoader.exe"

Run($var2, $var1)

somthing like that ?

oh and error = Unable to execute the external program.

the system cannot find the path specifed

evin thow the file is there :)

Edited by zipee
Link to comment
Share on other sites

oky i did this for testing

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")

$var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MindArk\Project Entropia", "")
$var2 = $var1 & "\ClientLoader.exe"

Send($var2)
Send("{enter}")
Send($var1)

and i get

h:\MindArk\Project Entropia\ClientLoader.exe

h:\MindArk\Project Entropia

that is corect

i jist cant get the run part to work

oh well ill try agan some other day thanks for the help all

Edited by zipee
Link to comment
Share on other sites

slow down, geranimo, you need quotes...

$var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MindArk\Project Entropia", "")
$var2 = $var1 & "\ClientLoader.exe"
Run('"' & $var2 & '"', $var1)

see... now you happy...

path/names with spaces need quotes...

Lar.

<{POST_SNAPBACK}>

Are you for real?

I thought quotes were only necessary when using the command interpreter.

Test:

Run("C:\Program Files\AutoIt3\Au3_Spy.exe")

This works.

Link to comment
Share on other sites

Are you for real?

I thought quotes were only necessary when using the command interpreter.

Test:

Run("C:\Program Files\AutoIt3\Au3_Spy.exe")

This works.

<{POST_SNAPBACK}>

The above command works because if you notice it has quotes around it.

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

I have found that when running a program the only time you need quotes is if you have a 'SPACE' in the file path. For instance,

run('C:\blob.exe')
;works
run('C:\Program Files\blob.exe')
;Doesn't work, notice the space between 'Program' and 'Files'
run('"C:\blob.exe"')
run('"C:\Program Files\blob.exe"')
;Works regardless of spaces if you have the "s IN the ACTUAL command line STRING (marked by 's)

It has to do with whenever there is a space it is considered to be a new parameter.

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

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