Jump to content

Getting Current Directory Help


Duran
 Share

Recommended Posts

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.

Link to comment
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")
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...