Timeline for How to check if a directory exists in Windows?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 5 at 0:20 | review | Suggested edits | |||
Jan 5 at 10:42 | |||||
Mar 5, 2021 at 9:14 | comment | added | Egor Hans | Verifying it's a directory is apparently "a bit" more compicated. See stackoverflow.com/questions/21033801/… and stackoverflow.com/questions/8666225/… for details and solutions. | |
Jan 27, 2017 at 4:44 | review | Suggested edits | |||
Jan 27, 2017 at 9:11 | |||||
Jun 3, 2014 at 11:24 | history | edited | barlop | CC BY-SA 3.0 |
added important somewhat corrective comment
|
Jun 3, 2014 at 11:13 | comment | added | barlop |
@sunglim by writing ` If not exist myDirName\ ` similarly if not 1==1 echo hmm or if exist myDirName\ ELSE blahblahblah
|
|
Jan 9, 2014 at 6:43 | comment | added | Sungguk Lim | how can i check if not exist? | |
Dec 6, 2011 at 13:30 | comment | added | phogg | @grawity: If it exists but is a file the script will probably fail later when trying to use it as a directory, which probably isn't what you want. | |
Dec 6, 2011 at 13:09 | comment | added | grawity |
@phogg: In the context of this specific question: if it exists but is a file, you still cannot mkdir it.
|
|
Dec 6, 2010 at 16:58 | comment | added | phogg |
This is correct for testing file existence, but how do you know that it's a directory? The simplest answer is if exist mydirname\ and the rest as you say. Alternately, you could actually get a test binary and use it on Windows.
|
|
Dec 6, 2010 at 16:58 | vote | accept | Pietro | ||
Dec 6, 2010 at 16:47 | history | answered | Sathyajith Bhat♦ | CC BY-SA 2.5 |