Ask for drive to create dynamic path within a command of a batch file

241 Views Asked by At

The title is a bit odd, but I want to create a hard link to a folder where the user specifies the drives.

The command is mklink /j and I need %driveone%:\Fixed\Path and %drivetwo%:\Fixed\Path as it's variables. Anyone know how I can prompt the input to define the drives?

1

There are 1 best solutions below

0
On BEST ANSWER
set /p "driveone=Drive one ? "

is the standard "get user input to a variable" formula.

If you want to input from the command line, then

set "driveone=%1"
set "drivetwo=%2"

would allow you to run

yourbatch c d

to assigng c and d to driveone/two respectively.