1.

Solve : Also a bat file question,help?

Answer»

I am a green hand. I COME across this qustion:
Batch File CREATION
a. Name the file output.bat.
b. The file should receive as input two parameters-a command and a file name-and should REDIRECT the output of the command to the specified file:
output command filename
c. The output.bat batch file should error-check to determine if a file by the name of filename already exists.
d. If a file by the name of filename already exists, the batch file should not OVERWRITE the existing file but return an error message that reads:
filename already exists.

hope someone nice can help me! Thanks~~~~~~~~not going to do the whole thing, but just some suggestions.

a: i am sure you know how to name it as output.bat
b: to receive parameters from the script use %1, %2 etc
c: use IF EXISTS to check for existence of the file
d: can use GOTO ERROR where you display your error message

There are many references on the web. I randomly got you 2.
http://labmice.techtarget.com/scripting/default.htm
http://www.cs.ntu.edu.au/homepages/bea/home/subjects/ith305/description.html




Discussion

No Comment Found