Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy only writable file

Status
Not open for further replies.

EvilCabal

Programmer
Jul 11, 2002
206
CA
Hi all,

first sorry if this is not the good forum to post this question I could not find anything more suitable.

I am trying to create a batch file that will simply copy all files in a given directory that have the read-only attribute set to false. My goal is to back-up checked-out source files from a project without having to copy every unmodified files. Copy and XCopy both seem to lack the option to do that. Is there a free alternative that would give me this option. If am under WinXP Pro.

Thanks you!
 
Have you looked at scripting to do this sort of thing?


DOS batch files are very limited as you have found.

To be honest I would use my own preferred programming language (Delphi) to do this, but any language that can access the Windows API commands will do. Specifically you need to test the results of FileGetAtributes() (I think its that) which will tell you if read-only is set.



Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
Or you can look at forum329 here.

Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
I know I could write one myself but it would feel like reinventing the wheel. All I need is to copy writable files, I can't believe I have to write such a basic thing from scratch...

I'll have a look at the VBScript forum.

Thanks.
 
Robocopy <source> <dest> /ia:R

That should do it per :
Download here:
_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top