|
| | |||||||
| Windows XP Discuss the Microsoft Windows XP Operating System |
| | LinkBack | Thread Tools |
| |||
| xcopy command line for files and folders I have a partition that stores video. I store folders with names like: Tape 10 Tape 10 DL Tape 11 Tape 11 DL There are also files in the root with various extensions starting with: tape 10.avi tape 10.avi.index tape 10.scn What is the simplest xcopy command that will copy all the files in the root and also copy all the folders to another drive? I would like to be able to use wildcards for the tape numbers (1?) if possible. Thanks, Terry R. -- Anti-spam measures are included in my email address. Delete NOSPAM from the email address after clicking Reply. |
| |||
| Re: xcopy command line for files and folders Terry, START | RUN | Type 'cmd' & press ENTER Type 'xcopy /?' & press ENTER Now you see a list of switches Another way is to search Google yourself -- SPAMCOP User "Terry R." <F1Com@NOSPAMpobox.com> wrote in message news:e0WzeEy6JHA.1424@TK2MSFTNGP02.phx.gbl... >I have a partition that stores video. I store folders with names like: > Tape 10 > Tape 10 DL > Tape 11 > Tape 11 DL > > There are also files in the root with various extensions starting with: > tape 10.avi > tape 10.avi.index > tape 10.scn > > What is the simplest xcopy command that will copy all the files in the > root and also copy all the folders to another drive? I would like to be > able to use wildcards for the tape numbers (1?) if possible. > > Thanks, > > Terry R. > -- > Anti-spam measures are included in my email address. > Delete NOSPAM from the email address after clicking Reply. |
| |||
| Re: xcopy command line for files and folders The date and time was Thursday, June 11, 2009 11:11:21 PM, and on a whim, SPAMCOP User pounded out on the keyboard: > Terry, > > START | RUN | Type 'cmd' & press ENTER > > Type 'xcopy /?' & press ENTER > > Now you see a list of switches > > Another way is to search Google yourself > If I hadn't already done that, I wouldn't be posting here. Maybe you think asking a question is a first resort for some people. It's my last resort. Terry R. -- Anti-spam measures are included in my email address. Delete NOSPAM from the email address after clicking Reply. |
| |||
| Re: xcopy command line for files and folders On Jun 12, 1:46*am, "Terry R." <F1...@NOSPAMpobox.com> wrote: > I have a partition that stores video. *I store folders with names like: > Tape 10 > Tape 10 DL > Tape 11 > Tape 11 DL > > There are also files in the root with various extensions starting with: > tape 10.avi > tape 10.avi.index > tape 10.scn > > What is the simplest xcopy command that will copy all the files in the > root and also copy all the folders to another drive? *I would like to be > able to use wildcards for the tape numbers (1?) if possible. > > Thanks, > > Terry R. > -- > Anti-spam measures are included in my email address. > Delete NOSPAM from the email address after clicking Reply. Even though I use Windows Explorer with reluctance, have you thought about using that - bring up your C drive, select (highlight) the folders you want, copy, paste them to your new drive. You can select multiple folders by holding down the CTRL key and clicking them one at a time - do you know how to do stuff like that in Windows Explorer? If you select a folder(s), it will take everything under it when you copy and paste it. Notice I am not saying cut and paste. If you want to remove the source folders later, that is up to you. I know how to use XCOPY, but in this case, I might have to go with Windows Explorer... It is also an easier to comprehend visual experience than XCOPY. You might have to make a few passes to get everything - there may not be a practical method to do it all in one fell swoop. Unless there is some reason you think you need to use XCOPY, then maybe you could explain that to better understand your goal. |
| |||
| Re: xcopy command line for files and folders On Jun 12, 6:44*am, "Terry R." <F1...@NOSPAMpobox.com> wrote: > The date and time was Thursday, June 11, 2009 11:11:21 PM, and on a > whim, SPAMCOP User pounded out on the keyboard: > ..snip... > If I hadn't already done that, I wouldn't be posting here. *Maybe you > think asking a question is a first resort for some people. *It's my last > resort. > > Terry R. I've had Windows Explorer file copy commands too often leave a copied file corrupted, so... For many applications, I also prefer XCOPY. I've written several batch files and leave them on the Desktop. That way, when I want 'backup', or synchronizing filesets; I simply double click on the icon. If you're interested in that type of approach... an example of a batch file to only transfer files with new dates, or are newly created:: filename D2F.bat echo off verify on xcopy D:\AAA\$Contacts\*.* F:\AAA\$Contacts\*.* /D /E /C /H /Y pause echo on 'pause' stops WinXP from exiting [and blanking all the inofrmation of what just happened] before you can read the list of files or see a list of the activity. Of important note with XCOPY, be sure to set VERIFY ON, else, and this has happened to me more than once, Windows will copy and corrupt your file and you'll never know until you go to use it. Robert |
| |||
| Re: xcopy command line for files and folders On Jun 12, 10:29*am, Robert Macy <m...@california.com> wrote: > On Jun 12, 6:44*am, "Terry R." <F1...@NOSPAMpobox.com> wrote: > > > The date and time was Thursday, June 11, 2009 11:11:21 PM, and on a > > whim, SPAMCOP User pounded out on the keyboard: > > ..snip... > > If I hadn't already done that, I wouldn't be posting here. *Maybe you > > think asking a question is a first resort for some people. *It's my last > > resort. > > > Terry R. > > I've had Windows Explorer file copy commands too often leave a copied > file corrupted, so... > > For many applications, I also prefer XCOPY. > > I've written several batch files and leave them on the Desktop. *That > way, when I want 'backup', or synchronizing filesets; I simply double > click on the icon. > > If you're interested in that type of approach... > > an example of a batch file to only transfer files with new dates, or > are newly created:: > > filename D2F.bat > > echo off > verify on > xcopy D:\AAA\$Contacts\*.* *F:\AAA\$Contacts\*.* */D */E */C */H */Y > pause > echo on > > 'pause' stops WinXP from exiting [and blanking all the inofrmation of > what just happened] before you can read the list of files or see a > list of the activity. > > Of important note with XCOPY, be sure to set VERIFY ON, else, and this > has happened to me more than once, Windows will copy and corrupt your > file and you'll never know until you go to use it. > > Robert Well, a copy through explorer is supposed to do some kind of verify (move and cut/paste I am not sure), but it seems people have trouble with it or just don't trust it from some bad experience usually with manipulating large amounts of data. I have no need to copy large amounts from here to there - I just put it there to begin with. It would seem that there is probably some third party alternative GUI approach that has more verification things built in, but I have no need to do the research. In the long run you gotta go with what makes you feel the most confident... |
| |||
| Re: xcopy command line for files and folders The date and time was Friday, June 12, 2009 7:29:24 AM, and on a whim, Robert Macy pounded out on the keyboard: > On Jun 12, 6:44 am, "Terry R." <F1...@NOSPAMpobox.com> wrote: >> The date and time was Thursday, June 11, 2009 11:11:21 PM, and on a >> whim, SPAMCOP User pounded out on the keyboard: >> ..snip... >> If I hadn't already done that, I wouldn't be posting here. Maybe you >> think asking a question is a first resort for some people. It's my last >> resort. >> >> Terry R. > > I've had Windows Explorer file copy commands too often leave a copied > file corrupted, so... > > For many applications, I also prefer XCOPY. > > I've written several batch files and leave them on the Desktop. That > way, when I want 'backup', or synchronizing filesets; I simply double > click on the icon. > > If you're interested in that type of approach... > > an example of a batch file to only transfer files with new dates, or > are newly created:: > > filename D2F.bat > > echo off > verify on > xcopy D:\AAA\$Contacts\*.* F:\AAA\$Contacts\*.* /D /E /C /H /Y > pause > echo on > > 'pause' stops WinXP from exiting [and blanking all the inofrmation of > what just happened] before you can read the list of files or see a > list of the activity. > > Of important note with XCOPY, be sure to set VERIFY ON, else, and this > has happened to me more than once, Windows will copy and corrupt your > file and you'll never know until you go to use it. > > Robert Hi Robert, I have been using WE for a long time. Since I have files in more than one location, I thought it would be more useful to create a batch file with everything being copied within one script, rather than waiting 45 minutes for the first copy to complete, then grab another set of files/folders and copy again, then repeat the processes to yet another external drive (I create 2 backup copies on external drives before removing the files from the internal drives). These are large video files and take a long time to copy. I use xcopy to backup my data each day to another internal drive, so I'm familiar with using it, and I'm also an old DOS batch file user. It's just the commands I used copied the files, but not the folders. And every variation I tried didn't resolve it. That's why I finally asked in here. I also read that VERIFY doesn't matter in xcopy. It's used only for compatibility. Terry R. -- Anti-spam measures are included in my email address. Delete NOSPAM from the email address after clicking Reply. |
| |||
| Re: xcopy command line for files and folders The date and time was Friday, June 12, 2009 7:15:02 AM, and on a whim, Jose pounded out on the keyboard: > On Jun 12, 1:46 am, "Terry R." <F1...@NOSPAMpobox.com> wrote: >> I have a partition that stores video. I store folders with names like: >> Tape 10 >> Tape 10 DL >> Tape 11 >> Tape 11 DL >> >> There are also files in the root with various extensions starting with: >> tape 10.avi >> tape 10.avi.index >> tape 10.scn >> >> What is the simplest xcopy command that will copy all the files in the >> root and also copy all the folders to another drive? I would like to be >> able to use wildcards for the tape numbers (1?) if possible. >> >> Thanks, >> >> Terry R. >> -- >> Anti-spam measures are included in my email address. >> Delete NOSPAM from the email address after clicking Reply. > > Even though I use Windows Explorer with reluctance, have you thought > about using that - bring up your C drive, select (highlight) the > folders you want, copy, paste them to your new drive. > That's the way I've been doing it for the last few months. > You can select multiple folders by holding down the CTRL key and > clicking them one at a time - do you know how to do stuff like that in > Windows Explorer? Yes. > > If you select a folder(s), it will take everything under it when you > copy and paste it. Notice I am not saying cut and paste. If you want > to remove the source folders later, that is up to you. > > I know how to use XCOPY, but in this case, I might have to go with > Windows Explorer... It is also an easier to comprehend visual > experience than XCOPY. > > You might have to make a few passes to get everything - there may not > be a practical method to do it all in one fell swoop. > That's why I wanted to implement a batch file instead. Doing all the copying of different files/folders to 2 different external drives takes a very long time, and if I'm not there when one operation ends, it sits there idle until I start the next copy. > Unless there is some reason you think you need to use XCOPY, then > maybe you could explain that to better understand your goal. The above should explain it. Terry R. -- Anti-spam measures are included in my email address. Delete NOSPAM from the email address after clicking Reply. |
| |||
| Re: xcopy command line for files and folders "Terry R." <F1Com@NOSPAMpobox.com> wrote in message news:e0WzeEy6JHA.1424@TK2MSFTNGP02.phx.gbl... >I have a partition that stores video. I store folders with names like: > Tape 10 > Tape 10 DL > Tape 11 > Tape 11 DL > > There are also files in the root with various extensions starting with: > tape 10.avi > tape 10.avi.index > tape 10.scn > > What is the simplest xcopy command that will copy all the files in the > root and also copy all the folders to another drive? I would like to be > able to use wildcards for the tape numbers (1?) if possible. > > Thanks, > > Terry R. > -- > Anti-spam measures are included in my email address. > Delete NOSPAM from the email address after clicking Reply. Maybe I'm missing something important, in particular since you're an experienced batch file programmer, but I would have thought that this two-liner would do the trick: Line1=@echo off Line2=for /d %%a in (U:\tape*.*) do echo xcopy /s /c /d /y "%%a\*.*" "\\RemoteServer\SomeShare\SomeFolder%%~pa%%~na \" Line3=echo xcopy /s /c /d /y U:\tape*.* "\\RemoteServer\SomeShare\SomeFolder\" Remove the word "echo" in lines 2 and 3 to activate the batch file. |
| |||
| Re: xcopy command line for files and folders The date and time was Friday, June 12, 2009 10:57:07 AM, and on a whim, Pegasus [MVP] pounded out on the keyboard: > "Terry R." <F1Com@NOSPAMpobox.com> wrote in message > news:e0WzeEy6JHA.1424@TK2MSFTNGP02.phx.gbl... >> I have a partition that stores video. I store folders with names like: >> Tape 10 >> Tape 10 DL >> Tape 11 >> Tape 11 DL >> >> There are also files in the root with various extensions starting with: >> tape 10.avi >> tape 10.avi.index >> tape 10.scn >> >> What is the simplest xcopy command that will copy all the files in the >> root and also copy all the folders to another drive? I would like to be >> able to use wildcards for the tape numbers (1?) if possible. >> >> Thanks, >> >> Terry R. >> -- >> Anti-spam measures are included in my email address. >> Delete NOSPAM from the email address after clicking Reply. > > Maybe I'm missing something important, in particular since you're an > experienced batch file programmer, but I would have thought that this > two-liner would do the trick: > Line1=@echo off > Line2=for /d %%a in (U:\tape*.*) do echo xcopy /s /c /d /y "%%a\*.*" > "\\RemoteServer\SomeShare\SomeFolder%%~pa%%~na \" > Line3=echo xcopy /s /c /d /y U:\tape*.* > "\\RemoteServer\SomeShare\SomeFolder\" > > Remove the word "echo" in lines 2 and 3 to activate the batch file. > > Thanks Pegasus, I'll give that a try. I had tried tape*.* with xcopy, but not using FOR. It would copy what was in the root folder, but not the folders and data themselves. Terry R. -- Anti-spam measures are included in my email address. Delete NOSPAM from the email address after clicking Reply. |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the command line command for unzipping files? | Jim H | Windows Vista | 2 | 02-14-2009 03:15 PM |
| What is the command line command for unzipping files? | Jim H | Windows Vista | 2 | 12-03-2008 08:30 PM |
| Command line to remove duplicate files? | Ohmster | Linux | 15 | 03-20-2008 08:10 PM |
| Command line for changing files / folders ownership | ms gates | Windows XP | 3 | 06-25-2007 10:40 PM |
| "Delete" files by moving it to the Trash Can/Recycler from the command line? | per9000 | Windows XP | 22 | 01-04-2007 05:30 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |