Klexen Posted July 6, 2007 Share Posted July 6, 2007 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 More sharing options...
Pakku Posted July 6, 2007 Share Posted July 6, 2007 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 How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me Link to comment Share on other sites More sharing options...
Klexen Posted July 6, 2007 Author Share Posted July 6, 2007 (edited) I figured it out.. Thanks! $CurrentDir = @ScriptDir If $CurrentDir = "C:\Users\klexen\Desktop\SuperLaunch" Then MsgBox(0,"!","You are running this from an invalid location Copy to you U:\ Drive") Exit Else MsgBox(0,"","You are running this from a valid dir.") EndIf Edited July 6, 2007 by Klexen Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now