Sign in to follow this  
Followers 0
mistykz

Executing a program

6 posts in this topic

Hi everyone, I apologize in advance but I'm new to this and couldn't find an answer elsewhere. I'm trying to start an exe, and then have the script fill in two text fields and hit enter. I'm pretty sure I can get it to do the entry, but the problem I'm having is that I can't even get the program to execute in the first place. Here's what I'm using, pretty simple:

Run("C:\Program Files\Teq WiD-ENT\Teq WiD-ENT.exe")

When I run the script, nothing happens. If I replace that file path with a path to notepad, ms word, or other programs they open up just fine! I've also tried using RunAsWait, but again, nothing happens.

When I open Teq Wid-ENT.exe by clicking on it manually, the UAC window pops up and asks me to continue or cancel. Could this be what's causing the problem? I just assumed that the window would pop up when I executed it via script. Any help/advice would be greatly appreciated!

Share this post


Link to post
Share on other sites



Try #RequireAdmin at the top of the script. Other than that, make sure that you path is correct by running it from the command line or Run dialog

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You need to put quotes around it since it has spaces in the path.

Run('"C:\Program Files\Teq WiD-ENT\Teq WiD-ENT.exe"')
Edited by Richard Robertson

Share this post


Link to post
Share on other sites

Adding #RequireAdmin worked, thanks! Although now it's asking for permission for AutoIT to make changes, not the program I'm running :x Odd.

Share this post


Link to post
Share on other sites

mistykz,

This is a known problem with 'CreateProcess' - see ticket # 1771. Hopefully it will be documented in the AutoIt Help file eventually.

The best workaround is to use ShellExecute() for any process requiring elevation. This will remove any requirements for the script itself to be run with elevated privileges.

Note however that if your script is running under a lesser privilege level, you may run into some automation problems.

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