Jump to content

Need to check if program is running in a specified directory


Recommended Posts

I want to check to see if my program is being run in a certain directory if it is I want it to MsgBox then Exit. I tried making this up.. But doesnt work.

Can someone help me out please?

if @ScriptFullPath = "The directory" Then
    MsgBox(0,"YOU CAN NOT RUN THIS PROGRAM FROM THIS DIRECTORY!")
    Exit
EndIf

If @ScriptDir =  "The directory" Then
    MsgBox(0,"YOU CAN NOT RUN THIS PROGRAM FROM THIS DIRECTORY!")
    Exit
EndIf
Link to comment
Share on other sites

Hi,

I don't know dude, but according to the help file (and my thoughts)

@ScriptDir
returns a path and
"The directory"
isn't.

So read the helpfile before you post your questions.

Arjan

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...