Donate SIGN UP

Batch Files

Avatar Image
tpreece01 | 21:35 Thu 29th Nov 2007 | Computers
1 Answers
I need to create a batch file which will do the following:

Open an Excel file
If the specified file isn't found, copy it from the default location: j:\excel to z::\excel - then open the file

If it does exist, the copy must not take place as I don't want data deleting from the z:\ file.

Can anyone help with code to do this, I've already copied it and opened the file, I'm not sure about checking if it exists though.
Ideally it should all be automated without any user involvement.

Thanks in advance!
Gravatar

Answers

Only 1 answerrss feed

Best Answer

No best answer has yet been selected by tpreece01. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.


the lines you need are
if not exist z:\excel\test1.xls copy j:\test1.xls z:\excel
test1.xls

test1.xls

copy to a text file on your desktop ... or to a folder and create a shortcut (that way you can change the icon

rename it test1.bat

Only 1 answerrss feed

Do you know the answer?

Batch Files

Answer Question >>