Determine if given variable is a directory
<p>I have a batch file script that needs to verify if the directory that the user enters in is a real directory or path so that I can create it if it dose not exist.</p>

<pre><code>:GetDir
set /p Dir=
if not &lt;is directory?&gt; %Dir% goto:GetDir
if not exist %Dir% mkdir %Dir%
</code></pre>

<p>How can I determine if the value given by the user is a directory?
There are millions of things that the user could enter in that is obviously not a directory.</p>

<p>notes for editor:
This note is to be removed after the editor reads it. I apologize ahead of time if I was not supposed to add this note in. Please correct me so I don't do this again if this is the case and I would appreciate being told where to add these types of notes if a similar situation comes up again. I am trying to maintain and recover this question from when I originally asked it in order to fix my bad reputation for asking bad questions on here. This is not a duplicate question because the marked duplicate is in a different scripting language that I am unfamiliar with. I would also like to mention that I did to some heavy research before asking this question on the the issue that I was having. It would also be greatly appreciated if answering this question could be enabled again so that I can answer my own question because I am not sure that anybody else is going to have the answer, and I currently know how to answer it.</p>