vickerps Posted September 24, 2008 Share Posted September 24, 2008 Hi this in relation to another post but kind of a seperate question so here goes when you use run(C:\windows\notepad.exe) if a working directory is not supplied like (above) what does autoit use as default? does it set the working directory to where script was started from? If so can this be changed so that the working directory by default is the location path of exe being kicked of? Link to comment Share on other sites More sharing options...
NeoFoX Posted September 24, 2008 Share Posted September 24, 2008 Hey.. Run(); will use the directory where your script is in as your default directory. Greetz, Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
vickerps Posted September 25, 2008 Author Share Posted September 25, 2008 Thanks neofox I thought as much. however i need a way of making the work directory the same as the file being kick off without supplying it. for example i have a program that looks to a ini file for things to run. The list could include anything eg. Action.ini [Action] Run1=c:\windows\notepad.exe Run2=C:\name\bob.exe .... ... .. . Run999=C:\somthingelse.exe Some programs being run require the working directory to be where program originates from example "c:\name\bob.exe" needs a working directory of C:\name\ where as C:\somthingelse.exe needs it working directory as c:\ Because i wouldn't know this in advanced (I don't know what is being run) I need a way for autoit to default the working directory to where the file lives and not where the script is being call from. A simple .bat appears to work in this manner however i don't want to use a .bat file I want to use autoit I hope this makes sense. Can anyone help? Link to comment Share on other sites More sharing options...
NeoFoX Posted September 25, 2008 Share Posted September 25, 2008 Ooh oké Perhaps try the Run command like this: Run(@ComSpec & " /c " & 'notepad.exe', ""); Run(@ComSpec & " /c " & 'bob.exe', ""); Greetz, Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
vickerps Posted September 26, 2008 Author Share Posted September 26, 2008 Tried using @comspec but no joy Link to comment Share on other sites More sharing options...
youknowwho4eva Posted September 26, 2008 Share Posted September 26, 2008 if your ini has the path why not just $array = inireadsection("whereever:\action.ini","action") For $n = 1 to $array[0][0] step +1 run(iniread("whereever:\action.ini","action","run" & $n,"")) next ? Giggity 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