Sign in to follow this  
Followers 0
vickerps

working directory

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

Tried using @comspec but no joy :)

Share this post


Link to post
Share on other sites

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

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