Jump to content

Problem with Run


Vivek221
 Share

Recommended Posts

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
Link to comment
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")
Link to comment
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

Link to comment
Share on other sites

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>

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