Sign in to follow this  
Followers 0
Guest zipee

run and Variables

10 posts in this topic

#1 ·  Posted (edited)

oky y wont this work ?

Run($var2, $var1)

plz help

Edited by zipee

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

are the variables before the Run($var2, $var1) or after?? And whats the error you get.?

EDIT: you beat me to it larry. :)

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

Looks to me that this has quotes, only to tell autoit that it is a string.

Run("C:\Program Files\AutoIt3\Au3_Spy.exe")
But using the variables, autoit already knows it is a string. So quotes, seem to be not required.

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