Sign in to follow this  
Followers 0
Duran

Getting Current Directory Help

5 posts in this topic

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

How about @ScriptDir

Share this post


Link to post
Share on other sites

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

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

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  
Followers 0