Question

I am writting a script and I've run into a block, what I need to do is run a .bat file (not run in cmd) that will prompt for the source and then prompt for the destination, it would then take that data and perform a robocopy command that I have.

How do I do this?

Was it helpful?

Solution

Do it like this:

set /p src=Please enter source: 
set /p dest=Please enter destination: 
robocopy ... %src% %dest%

When run, this will prompt the text (on the right) in the console and assign the user input to the variable[s] (on the left). Try it!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top