Vivek221 Posted December 19, 2011 Share Posted December 19, 2011 (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 December 19, 2011 by Vivek221 Link to comment Share on other sites More sharing options...
Chimaera Posted December 19, 2011 Share Posted December 19, 2011 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") If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 19, 2011 Share Posted December 19, 2011 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> Link to comment Share on other sites More sharing options...
Vivek221 Posted December 20, 2011 Author Share Posted December 20, 2011 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 More sharing options...
sleepydvdr Posted December 20, 2011 Share Posted December 20, 2011 (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 December 21, 2011 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Vivek221 Posted December 21, 2011 Author Share Posted December 21, 2011 Thanks. Regards, VIvekananda Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now