Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I work for a release management team for a company handling all the releases of files that are placed into production environment every week.
Now I am trying to write a dos batch file which would do the following:
Compare the names of the files that are going to be released with the existing files that are already on the server and then show me a report saying which are the files that are going to be replaced and ask for confirmation from me before the actual replacement of file happens.
Also this report showing which files are being replaced should be sent over to me via an e-mail.
Any help will be appreciated.

First, NT/XP is not DOS, so it's one or the other.
I'm not clear on what's needed. Is the list of source files a subset of the files on the server?
=====================================
If at first you don't succeed, you're about average.M2

I am trying to write a batch file in DOS which will do the following:
Step 1: Copy some files(like for example a.txt, b.txt, c.txt) from a disk location C:/
Step 2: Put the above copied files to a disk location C:/Release/
Step 3: Before putting the files from the location C:/ to C:/Release/ it should make a note of files that are going to be replaced(if say for example a.txt, b.txt, c.txt already exists in the location C:/Release/)
Step 4: Ask for confirmation saying following are the files that are going to be replaced...do you want to continue?
Step 5: Send an e-mail to my mailbox with a report saying which all files were replaced.
Hope this clarifies...now can someone help

Here are some Windows XP batch file commands you can use. (Note that these won't work in DOS, but I am assuming you are not using DOS but Windows XP's cmd.exe.)
@echo off
setlocal
pushd C:\Release
dir a.txt b.txt c.txt
set p=N
set /p p=Do you want to overwrite the above files (Y/N)?
if /i %p% == y for %%f in (a.txt b.txt c.txt) do copy ..\%%f .
start mailto:user@example.com?subject=The%20files%20have%20been%20copiedIf you want a better automatic emailing facility, you will have to download a command-line email utility. I hope the above helps to get you started.

![]() |
![]() |
![]() |

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