Computing.Net > Forums > Programming > Bat Copy Files - Skip Open Ones?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Bat Copy Files - Skip Open Ones?

Reply to Message Icon

Name: trdj
Date: February 24, 2006 at 15:33:24 Pacific
OS: XP
CPU/Ram: Lots
Comment:

I have a bat that basically just copies a directory of PSTs, but sometimes they are left open (users logged in). I am looking for a bat that will just go down the list and copy the ones that are available to be copied (not open).

As it is now if the 2nd PST in the list is locked then that's it, I will have only copied (or backed up) two PSTs.

Is there a way to use a combination of Bats to create a 2nd bat with a list of the file names, then pull it in and read it and do a copy on files "if not errorlevel 1" skipping to the next when a file is locked?

adv(THANKS)ance!

michael



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: February 25, 2006 at 00:32:34 Pacific
Reply:

Good question.

I just copied a whole directory and it got the one which was open.

I guess the easy answer, if yours doesn't, is to use xcopy /c which continues even if there are errors.


If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: astroraptor
Date: February 25, 2006 at 12:54:08 Pacific
Reply:

For /F %%n in ([file with the list of files]) Do Copy %%n

That's to retrieve from a list, but I'm not sure what you mean by "open" or "locked".


0

Response Number 3
Name: trdj
Date: February 27, 2006 at 07:51:37 Pacific
Reply:

heh. guess I should get more familiar with "xcopy" that was a much easier solution.

Thanks M2!

Michael


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Simple Batch Is it called Memo Fat?



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Bat Copy Files - Skip Open Ones?

Copy files by date modified www.computing.net/answers/programming/copy-files-by-date-modified/15932.html

.bat file to open multiple programs www.computing.net/answers/programming/bat-file-to-open-multiple-programs/7546.html

bat: Copy remote file & rename www.computing.net/answers/programming/bat-copy-remote-file-rename/16441.html