Jump to content

Determine the path, from where my script is launched


Recommended Posts

Hi there,

i´m totally new to AutoIT and at the moment playing around with

this great scripting language :)

I´m just not sure how to solve the following:

I´m writing a App which should only be run from a usb stick,

a user should not be able to copy the app to the c: or d: drive.

When he does this, he should get an error message.

My problem is, i´m not sure how to find out, from where my script is running.

Any ideas? :) Thanks in advance for your help

Link to comment
Share on other sites

Instead of making the paths to the .ini files and such relative make it a full pathline. You can use DriveGetDrive("Removable") to return an array of all removable data types then you can take those and instead of putting say

FileOpen("emailInfo.text") you can put it so it's a full filepath using said array :)

I'm kinda new to this to so its teh best I could think of...

Link to comment
Share on other sites

Hi, Seoke,

thanks for the fast reply,

but i actually don´t understand everything you mentioned.

When i use DriveGetDrive( "Removable" ) i get an array of the

removable drives, clear so far. But i´m still not sure how to find out the full path from

which the script is executed or how opening a file should help me?

And what exactly do you mean with "putting"?

I hope the questions aren´t too dumb :)

Thanks again.

Edited by JNoir
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...