0

I would like to be able to get path from user like (C:\Users\mehak\Downloads\folderA\folderB)

SET /P USER_INSTALL= Installation Path : 

Now i want to check if (FolderA) exists then create a subfolder (folderB).

Does anybody have any idea how can i create a batch file to allow me to do this?

1

1 Answer 1

0
MD "%user_install%\folderb"  >nul 2>nul
if exist "%user_install%\folderb\." (
 echo Folderb created
) else (
 echo Folderb not created
)

Will create folderb under %user_install% whether or not either already exists.

Don't move the parentheses in the if statement - they are quite critical.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.