User Input Operation in Windows batch Programming

2019-03-06 07:44发布

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%**

标签: input
1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-03-06 07:59

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%
查看更多
登录 后发表回答