Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am running windows 98 and wanted to create a batch file that would copy a text file from one directory to a backup directory on our server and rename the file to the current date at the same time. Any help would be much appreciated.

Why wouldn't you use a backup command in windows?
But for DOS...
If it's the same file it can be hard coded into the command.
you'll need to map the network drive in win98 and create a batch file in the command window. /start/run/command
keep in mind that even though the command window displays directory structure with long names, the DOS shell will expect the "8chr.3chr" filename format, no spaces.
open the command window and type "help copy" for the syntax. You can choose to replace or append the destination file and that should assign a new file date.
I'll keep an eye on this thread.

First, get the current date into a variable without separators, so it can be used as part of a filename:
FAQ #02 - Get date into a variable without separators
Then, use the variable, let's say %DATE%, to copy/rename the file. Example:
copy \\servername\location\file.txt c:\backupfolder\%DATE%.txt
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br_________________________________________________________________

![]() |
hard disk failure after m...
|
Copying files-date as a p...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |