Discussion Locked
0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like to know if it is possible to copy a file in DOS on a WINNT workstation to the current date. I tried %date% and it did not work. If not in DOS, how about in C ? I have an old copy of a C compiler for Dos. Thanks
3 replies
by joseph moore
Wait a sec. Let me make sure I understand your question.
Are you asking how to copy a file, and have the file name of the copy be the current date? If so, here is how.
Say you want to copy C:\Temp\FILE1.TXT into C:\Backup with a filename of 10-15-2003.txt
This BAT file will do it:
@echo off
c:
cd\
cd temp
for /f "tokens=1-4 delims=: " %%i in ('date /t') do set nowdate=%%j-%%k-%%l
copy FILE1.TXT C:\Backup\%nowdate%.txt
EXIT
by jrosalia
Great. thanks for your help
by jrosalia
This question was closed by the author
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
Discussion Locked
What Makes a Business Website Effective in 2026
2 helpful
10 replies
1 helpful
3 replies
Question
Windows and macOS computers becoming slow or unstable after updates - what should I check first
0 helpful
1 reply
Question Unanswered
Best Way to Make Long WordPress Location Guides Mobile Friendly
0 helpful
0 replies
Discussion
Optimizing WordPress widgets and DOM size
0 helpful
3 replies