Jump to content

Recommended Posts

Posted

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?

Posted

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?

Posted

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

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
×
×
  • Create New...