Sign in to follow this  
Followers 0
GoofyGremlin

Problem with Run()

14 posts in this topic

I am very new to AutoIT so please forgive me.

I am trying to write a program to start Renamer.exe which is located at C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe. The code:

Run("C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe", "C:\Program Files\Wizards of the Coast\Magic Online III\")

does nothing.

I have tried using the RunAs() function but this creates two problems. First, I would like the program to be exportable to other computers without have the new user to enter their profile password. Second, Renamer.exe launches other files and RunAs() leaves me in the wrong working directory, causing renamer.exe to have error messages and fail to work.

P.S. I am aware that there is an old thread with essentially the same issue, the code that isn't working for me is the solution provided in that thread.

Share this post


Link to post
Share on other sites



What happens when you enter this line in the Run console in the Start menu?

"C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe", "C:\Program Files\Wizards of the Coast\Magic Online III"

Entering:

C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe

into the run console on the start menu launches renamer.exe.

Share this post


Link to post
Share on other sites

I think one of these should work.

Run(@ProgramFilesDir & "\Wizards of the Coast\Magic Online IIII\Renamer.exe")

Run(@ProgramFilesDir & "\Wizards of the Coast\Magic Online IIII\Renamer.exe", @ProgramFilesDir & "\Wizards of the Coast\Magic Online IIII")

Just tried both of those, neither worked. Is it possibly the vista user account controls? I just can't understand why nothing happens, not even an error message.

Share this post


Link to post
Share on other sites

Tried that, compiled it, ran it as administrator and still nothing. Is there any way to just open the Run prompt from the start menu and paste the file path in there?

Share this post


Link to post
Share on other sites

Thanks a lot for your help. Maybe not as elegant as I would have liked but it will work.

Share this post


Link to post
Share on other sites

It appears I spoke too soon. The problem with this work-around is Admin rights on Vista. Since renamer.exe is being not being directly launched by my script it does not inherit the admin rights from #requireadmin and a user needs to be present every time the program would be launched. Since the whole idea of my script is to not require an active user, this is a major problem. Ideally once renamer.exe is launched it will run as long as the script, however it accesses a rather glitch-prone program that likes to randomly close and often requires restarting. If I can't get renamer.exe to inherit the admin rights from my script then anytime that program launches the script won't be able to restart it.

Share this post


Link to post
Share on other sites

RunAs?

I have two problems with run as. Its not portable to other computers and it messes up renamer.exe, causing it to have an error message that it cannot find the files its looking for in the working directory.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Search the forums for your issue. I've seen it before.

EDIT:

What does renamer actually do? Why not create that in AutoIt...

Edited by BrettF

Share this post


Link to post
Share on other sites

Renamer.exe is third-party software that is used to update the main software. I have tried opening the main file that renamer.exe opens but have the same problems I get when trying to use renamer.exe.

As for searching the forums, I am aware that there is basically the exact same problem in another thread, however the solution in that thread has not worked for me.

Share this post


Link to post
Share on other sites

You should write

Run("Renamer.exe", "C:\Program Files\Wizards of the Coast\Magic Online III")

or

Run("C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe"

Share this post


Link to post
Share on other sites

Neither of those work. Only thing working so far is opening it through the start menu's run module.

Share this post


Link to post
Share on other sites

Sadly neither of those worked either. This is very frustrating, seems like it should be so simple. Thanks for all the suggestions guys.

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