sher19
asked on
How to make prompted directory
Hi, I am prompting user for a directory to be created in my batch file using
set /p dir=Enter the folder to create:
but when I go to mkdir, it is not makeing the right directory.
Sometimes it makes 2 or more directorys from the command.
How can I fix this?
set /p dir=Enter the folder to create:
but when I go to mkdir, it is not makeing the right directory.
Sometimes it makes 2 or more directorys from the command.
How can I fix this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use the quotes around your directory...odds are the user is entering a directory with spaces in the name...
So, in your code, isntead of
mkdir %dir%
use
mkdir "%dir%"
Regards,
sirbounty