0

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

Mareena
  • 81
  • 2
  • 4
  • 9

1 Answers1

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%
Anuraj
  • 18,859
  • 7
  • 53
  • 79
  • As in above code, I want to pass the user input as a paramter in the path, for instance, in your given code, %theuserinput% is the variable, so is it possible that I pass this variable as in the move command like: move c:/cdrs/%theuserinput% d:/%theuserinput% I just want to move the files of a folder for which user entered the date e.g. 30062011 to the folder other folder of the same date??? – Mareena Jul 07 '11 at 17:33
  • anyone who can help in this regard?? – Mareena Jul 09 '11 at 20:47
  • check this link : http://stackoverflow.com/questions/26551/how-to-pass-command-line-parameters-in-batch-file – Anuraj Jul 10 '11 at 03:21