Sign in to follow this  
Followers 0
Vivek221

Problem with Run

6 posts in this topic

#1 ·  Posted (edited)

Hi all,

This is my first week with AutoIt. I wanted to run an application (ICI.exe) from my script. I have placed ICI.exe in "C:UsersTHIC" folder. I then used

Run("C:UsersTHICICI.exe") in the script . It says "System cannot find the specified file ".

Please advice.

Thanks,

Vivekananda

Edited by Vivek221

Share this post


Link to post
Share on other sites



maybe have a look at ShellExecute in the helpfile

This example of mine works fine but not all things like Run sometimes you need ShellExecute

RunWait(@ScriptDir & "file_includesinstallinstall_shockwave.exe /S")

Share this post


Link to post
Share on other sites

I have seen a program that needed the working directory specified. You could try this:

Run("C:\Users\TH\IC\ICI.exe", "C:\Users\TH\IC")

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Thanks vegan, your code helped. Can u explain why is the working directory set to "C:UsersTHIC", isn't it the place where my running script is located? I mean when the correct path is provided, why is the system unable to locate it?

Regards,

,

Vivekananda

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I think the problem lies in how the program you are running is designed. It may be taking in a parameter such as the location that initiated the program. Therefore, if you are running the AutoIt executable (or shortcut to the exe) from the desktop, it may try to look for other files that it needs in that directory. But I'm only making an educated guess that's what it is.

I have more experience with RunAs causing problems. If you are in a user account and you run a program from the administrator account, it will use the administrator's My Documents, temp folder, etc and not user account's. Sort of a similar thing to your problem.

Edited by sleepydvdr

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

Thanks.

Regards,

VIvekananda

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