| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Dec 02, 2009 10:15 am Post subject: How to check if a directory EXISTS ? |
|
|
| How can make a function to check IF a directory exists... THEN... ? |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Dec 02, 2009 10:19 am Post subject: Re: How to check if a directory EXISTS ? |
|
|
WOW, um, maybe IfExist? or...
| Code: | if (FileExist("dir")) {
msgbox, then???
} |
|
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 851
|
Posted: Wed Dec 02, 2009 1:34 pm Post subject: |
|
|
The above will of course work, but will also give true if there is a file with that name.
If you need to be sure that it is a directory, you can do something like this:
| Code: | If( InStr( FileExist("Dirname"), "D") )
msgbox Directory exists
|
_________________ Sector-Seven - Freeware tools built with AutoHotkey |
|
| Back to top |
|
 |
Newb2AHK Guest
|
Posted: Wed Dec 02, 2009 2:02 pm Post subject: Why not |
|
|
This is something i use everyday:
| Code: | IfNotExist, %CLogDir%
FileCreateDir, %LogDir% |
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Dec 02, 2009 7:00 pm Post subject: |
|
|
| thanks to everyone |
|
| Back to top |
|
 |
|