Siva Kumar
Siva Kumar

Reputation: 21

create a folder with a user defined name in batch

I need a batch code, where if I enter a number "11" and then a text "ss" then it should create a folder name as "11-ss", within the folder I need 3 folders named 1, 2, 3.

Is it possible?

Upvotes: 1

Views: 248

Answers (2)

npocmaka
npocmaka

Reputation: 57332

@echo off
set /p number=enter the number:
set /p text=enter the text:
md %number%-%text%\1 %number%-%text%\3 %number%-%text%\1  

this is an interactive solution ...

Upvotes: 1

KekuSemau
KekuSemau

Reputation: 6852

mkdir %1-%2\1
mkdir %1-%2\2
mkdir %1-%2\3

Save this as batch and call it by
batchfile.bat 11 ss

Upvotes: 3

Related Questions