Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: Wai_Wai on August 25, 2004, 12:45:27 AM

Title: About editing BAT files
Post by: Wai_Wai on August 25, 2004, 12:45:27 AM
About editing BAT files
I created a BAT file for a program called FSUM (It is a program for checksum).

In my BAT file, it contains:
fsum -md5 -r *.* >md5_checksum.txt

The above command will copy the output to a txt file. However if there's an existing file with the same name already, it will overwrite it without prompt.

How to prompt if the program is going to overwrite a file? Does anyone know any command which can do so?
Title: Re: About editing BAT files
Post by: jonah on August 25, 2004, 01:39:37 AM
Wai_Wai

Look at this link, it should give you some clues:

http://www.computerhope.com/msdos.htm

You might be able to do something like this:
fsum -md5 -r *.* >md5_%time%.txt

Its been a long time since I've done anything with DOS batch files. There are certainly others here who have more recent experience in this topic. Please correct me if I'm not correct. :)
Title: Re: About editing BAT files
Post by: Wai_Wai on August 25, 2004, 04:03:05 AM
Hi.
What does "%time%" in >md5_%time%.txt do?

Anyway, I tried it but the comptuter said "parameters are incorrect".

I read your suggested website before you told me, but in vain.
Title: Re: About editing BAT files
Post by: Wai_Wai on August 25, 2004, 04:04:43 AM
Quote
Wai_Wai

Look at this link, it should give you some clues:

http://www.computerhope.com/msdos.htm

You might be able to do something like this:
fsum -md5 -r *.* >md5_%time%.txt

Its been a long time since I've done anything with DOS batch files. There are certainly others here who have more recent experience in this topic. Please correct me if I'm not correct. :)



And since you said you don't use BAT for a long time, so did you find any other more powerful things to replace BAT?
If so, what are they and how good they are?