Reading Part of a File Name

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Stormen
Posts: 1
Joined: 28 Mar 2013 16:24

Reading Part of a File Name

#1 Post by Stormen » 28 Mar 2013 16:39

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.

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: Reading Part of a File Name

#2 Post by Endoro » 28 Mar 2013 18:05

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.

Post Reply