how to write a dos batch file for automatic file update?


[ Follow Ups ] [ Post Followup ] [ CPU-Central Message Board ] [ Home ]

Subject: how to write a dos batch file for automatic file update?
Name: Dude
Date: 2/6/2001 10:59:26 PM (GMT-7)
IP Address: 216.34.244.19
Message:

I want to write a .bat file on a floppy such that it automatically invokes dos copy command to replace a certain file at a certain directory on HD with a newer version of the same file on the floppy disk.

Here's what I want to achieve:
1. ask user to enter the drive letter on which the file is stored. (ie. c:, d:, e:....)
2. upon recieving the user's input, validate it (ie. check if c:\fixed_target_directory\ exists),
3. if the target directory doesn't exist, go back to step 2 + the option to quit,

if the target directory exist, copy new xxx_file from floppy to hard drive at c:\fixed_target_directory\ and automatically over-write the older xxx_file (preferably, the user won't have to respond to DOS's file over-write prompt).
4. message to user that the older file has been successfully replaced by the new one.
5. exit

Thanks a lot for your help.

[ View FollowUps | Post Followup | Main ]



Follow Ups:



Maximum of 100 messages displayed.

Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:
Upload some images for this post


[ Follow Ups ] [ Post Followup ] [ CPU-Central Message Board ]