User Input Operation in Windows batch Programming

2019-03-06 08:01发布

问题:

I want to take input from the user in ddmmyyyy format and when user enters the date in this format then files would move to the respective folder. I tried in the following code but failled.

SET /p str=Enter the name of the folder e.g. 30062011:

move C:\Documents and Settings\MyPC\Desktop*_%str%.pdf S:**%str%**

回答1:

What is failing? Move or accepting user input?

I tried following, and I am able to read the user input

@echo off
set /P theuserinput="Enter the filename: "

echo %theuserinput%


标签: input