vickerps Posted September 23, 2008 Posted September 23, 2008 Anyone help i am having problem kicking of an application using the Run() command. I have a script that look at a supplied list of the programs then sequentually they get passed through the a run() which intern kicks them off However one of the programs in the list doesn't work properly unless i provide the working directory as well (I don't want to do this) However i run the program through the run bar in window xp or even a simple bat file and the program works perfectly. Is there a command that mimicks this?
Achilles Posted September 23, 2008 Posted September 23, 2008 Have you tried ShellExecute()? I don't have any idea if that will work differently... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
martin Posted September 23, 2008 Posted September 23, 2008 Anyone help i am having problem kicking of an application using the Run() command.I have a script that look at a supplied list of the programs then sequentually they get passed through the a run() which intern kicks them offHowever one of the programs in the list doesn't work properly unless i provide the working directory as well (I don't want to do this)However i run the program through the run bar in window xp or even a simple bat file and the program works perfectly. Is there a command that mimicks this?Might be worth trying to change the working directory to th eexe directory befor eusing Run.FileChangeDir($exeDir) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
vickerps Posted September 24, 2008 Author Posted September 24, 2008 Might be worth trying to change the working directory to th eexe directory befor eusing Run.FileChangeDir($exeDir)First of thanks for the replies. I tried ShellExecute() but still has the same problem. Does no one know of a way that autoit can mimick exactly what a run line or bat file would do. Does windows setup the working directory for all programs launch it self and if so what does windows set the working dir too?
vickerps Posted September 24, 2008 Author Posted September 24, 2008 Might be worth trying to change the working directory to th eexe directory befor eusing Run.FileChangeDir($exeDir)First of thanks for the replies. I tried ShellExecute() but still has the same problem. Does no one know of a way that autoit can mimick exactly what a run line or bat file would do. Does windows setup the working directory for all programs launch it self and if so what does windows set the working dir too?
martin Posted September 25, 2008 Posted September 25, 2008 First of thanks for the replies. I tried ShellExecute() but still has the same problem.Did you try the FileChangeDir?Does no one know of a way that autoit can mimick exactly what a run line or bat file would do. Does windows setup the working directory for all programs launch it self and if so what does windows set the working dir too?As far as I know if you change the working directory to the same folder as you would use the command line from and then use Run it will be the same as using the command line. If you find it isn't then can you show what you are tryting to do? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
vickerps Posted September 26, 2008 Author Posted September 26, 2008 (edited) Did you try the FileChangeDir?As far as I know if you change the working directory to the same folder as you would use the command line from and then use Run it will be the same as using the command line. If you find it isn't then can you show what you are tryting to do?Hi MartinSorry i'm obviously having a dumb day because i don't understand what your saying. I hope this is what you mean.I have a few program that i need to run called wormhole.exe this little app look to where it being run from for dll and what not. If i run this from a bat file = works fineFrom window run line =works fineAutoit Run(c:\wormhole\wormhole.exe,"c:\wormhole\",@sw_hide) = works fineAutoit Run(@ComSpec & " /c " & 'c:\wormhole\wormhole.exe',"c:\wormhole\",@sw_hide) = works fineAutoit Run(c:\wormhole\wormhole.exe,"",@sw_hide) = doesn't workAutoit Run(@ComSpec & " /c " & 'c:\wormhole\wormhole.exe',"",@sw_hide) = doesn't workMy Problem is i need a way for autoit to use the working directory of the program being run? Edited September 26, 2008 by vickerps
martin Posted September 26, 2008 Posted September 26, 2008 Hi Martin Sorry i'm obviously having a dumb day because i don't understand what your saying. I hope this is what you mean. I have a few program that i need to run called wormhole.exe this little app look to where it being run from for dll and what not. If i run this from a bat file = works fine From window run line =works fine Autoit Run(c:\wormhole\wormhole.exe,"c:\wormhole\",@sw_hide) = works fine Autoit Run(@ComSpec & " /c " & 'c:\wormhole\wormhole.exe',"c:\wormhole\",@sw_hide) = works fine Autoit Run(c:\wormhole\wormhole.exe,"",@sw_hide) = doesn't work Autoit Run(@ComSpec & " /c " & 'c:\wormhole\wormhole.exe',"",@sw_hide) = doesn't work My Problem is i need a way for autoit to use the working directory of the program being run? Would this do what you want? $prog = "c:\wormhole\wormhole.exe";set vto the full path for the program to run $progDir = Stringleft($prog,StringInStr($Prog,'\',0,-1));extract the containing folder ConsoleWrite($progDir & @CRLF) Run($prog,$progDir,@sw_hide) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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