Path/Drive Problem

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
shitnever2016
Posts: 1
Joined: 18 Jan 2016 07:07

Path/Drive Problem

#1 Post by shitnever2016 » 18 Jan 2016 07:18

Output Looks like this:

Folder Manager
Enter Folder Name: ""
Enter Full Path/Drive: ""

My problem is, I've search on how to check if the is exist or not, but failed to use the codes.
Can anyone help me with this? Please see my codes below.

My CODE:

Code: Select all

@echo off
:top
cls
echo Folder Manager
set /p "fd= Folder Name: "
if "%fd%" == "" goto fdError
goto next
:next
set /p "path= Full Path/Drive: "
if "%path" == "" goto pathError
goto pathd
:fdError
echo Error Incountered. Please Try Again.
pause > nul
goto top

:pathError
echo You can't leave it blank.
pause > nul
goto top

:pathd
if exist %path% (
%path%
if exist %fd% (
 del %fd%
 md %fd%
)
goto finish
)
if not exist %path% (
echo Please check the path.
goto top
)
:finish
echo Directory - "%fd%" has been successfully created at "%path%".
pause >nul


Your help would be great help for me. Thank you in advance.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Path/Drive Problem

#2 Post by foxidrive » 18 Jan 2016 09:02

I don't know what your question is - but a variable name is typed wrong, and using path as a normal variable will easily break your code.

Post Reply