Jump to content
Sign in to follow this  
Duran

Getting Current Directory Help

Recommended Posts

Duran

I need help getting the Current directory that a script runs off of. Like mounting the drive so that the script can use it as its Home path or so. Its for a tool that will be running off a jump drive that will allow me to run scripts and executables from a user interface Autoit script. Or is it possible for me to just add in the paths like "scripts/test1/test1.exe" instead of adding in "C:" or something.

Share this post


Link to post
Share on other sites
Nahuel

How about @ScriptDir

Share this post


Link to post
Share on other sites
Duran

What would be a good example of using this? or is there a example on how to use it in the Help documents?

Share this post


Link to post
Share on other sites
Nahuel

MsgBox(0,"","Your script is running from: " & @ScriptDir)

@ScriptDir returns the path to the directory the script is running from. Let's say you're script is at C:\Scripts and you have a subdirectory with a program: C:\scripts\test1\test1.exe

If you want to run test.exe:

Run(@ScriptDir & "\test1\test1.exe")

Share this post


Link to post
Share on other sites
Duran

Thanks a bunch ^^ I will post my Script later once its all done thanks again.

~Robert

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.