PC Review


Reply
Thread Tools Rate Thread

Batch file query

 
 
Bill Ridgeway
Guest
Posts: n/a
 
      21st May 2006
I have a batch file which copies important files from the C: hard disk to
the D: hard disk. I recently found a few files in C:\Documents and settings
of which I would like to keep a copy. Not wanting to bother to copy some /
leave some I used XCOPY with flags /S /Y to copy the whole of the folder and
sub folders. (This worked OK on the original batch file). However, I have
found that not all the folders with files are being copied.

Any ideas why please?

Regards.

Bill Ridgeway


 
Reply With Quote
 
 
 
 
Shenan Stanley
Guest
Posts: n/a
 
      21st May 2006
Bill Ridgeway wrote:
> I have a batch file which copies important files from the C: hard
> disk to the D: hard disk. I recently found a few files in
> C:\Documents and settings of which I would like to keep a copy. Not
> wanting to bother to copy some / leave some I used XCOPY with
> flags /S /Y to copy the whole of the folder and sub folders. (This
> worked OK on the original batch file). However, I have found that
> not all the folders with files are being copied.
> Any ideas why please?
>
> Regards.
>
> Bill Ridgeway


--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html


 
Reply With Quote
 
Shenan Stanley
Guest
Posts: n/a
 
      21st May 2006
Bill Ridgeway wrote:
> I have a batch file which copies important files from the C: hard
> disk to the D: hard disk. I recently found a few files in
> C:\Documents and settings of which I would like to keep a copy. Not
> wanting to bother to copy some / leave some I used XCOPY with
> flags /S /Y to copy the whole of the folder and sub folders. (This
> worked OK on the original batch file). However, I have found that
> not all the folders with files are being copied.
> Any ideas why please?


Personally - I have started using the Microsoft SyncToy for such things.
That and Scheduled Tasks makes it much easier to do such backup procedures.

First - make sure you have permission to said directories - all of them.

Second - if the files/folders are in use - you may not be able to copy them
at that time.

Just use "/E" instead of "/S". It does the same thing - including copying
empty directories/sub-directories.

I have had batch scripts do this for me in the past.. I had them only
copying things that had changed since the last time it was ran. the line -
if I recall correctly - was:

xcopy c:\sourcedr\*.* z:\destinationdir\ /D /E /V /C /Q /G /H /R /K /X /Y

You can look at the xcopy help (or command line list) to see what each of
those switches do.

You may want to run the copy verbose - without actually copying and using
the /F and /L switches to see what *would* actually be copied - perhaps pipe
(>) the results to a test file for easy perusal.

--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open excel 2007 refresh query from batch file Brad Kelly Microsoft Excel Programming 0 2nd Jun 2010 04:50 PM
A script/batch to kill a batch file from scheduled tasks? Bogdan Windows XP Configuration 1 31st Jul 2009 06:05 AM
Batch file query of EWF status Michael Bate Windows XP Embedded 1 22nd Oct 2007 09:50 AM
A Batch File query Trevor L. Windows XP Customization 4 10th May 2006 06:40 PM
Query partitions from batch file Adrian Microsoft Windows 2000 CMD Promt 3 13th Nov 2003 08:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:18 PM.