Page 1 of 1

Reading Part of a File Name

Posted: 28 Mar 2013 16:39
by Stormen
Hi everyone First time posting and was looking for some help. I need to be able to read part of a file name thats based of user input namely a date like 12-12-12 and then copy that file to a different folder this is what i have so far

@Echo Off
Echo Please Enter Date
Set /P Date="Format 00-00-00: "
xcopy C:\testsource\%Date%.* c:\text
pause

Im not sure if its possible to read part of a filename but if anyone knows how please let me know of any suggestions.

Re: Reading Part of a File Name

Posted: 28 Mar 2013 18:05
by Endoro
What do you mean with 'part of a file name'?

Btw. you shouldn't use predefined batch variables like %date% and %time% for other purposes.