ms-dos question

I know it’s sad that I can’t get this to work, but I’m trying to create a batch file that will move some saved favorites from one dir to another. Here at work, they like to force what is in the favorites menu. So I add my own and then copy them to a back up dir. Then every day I have to delete the favorites that my work sets up, and copy the favorites I backed up earlier to the proper dir. It’s win2000 btw, anyone know the correct syntax for the copy command?

C:\Documents and Settings\jlarussa\My Documents\Bkp (back up dir)

C:\Documents and Settings\jlarussa\Favorites (where I need them moved)

Also all of them end in the extention .url, and if I just copy one at a time, it launches a IE window instead of copying. Any help would be welcome.

Why bother with DOS? Use Shift + right-click to select a range or CTRL + right-click to select and add individual files, and when you have them all, select Cut then open the folder you want to move them to, and select Paste. Done.

Use XCOPY to dig down into the lower directories…the raw Copy command doesn’t copy subdirs.

XCopy “C:\Docu…\Bkp*.*” “C:\Docu…\Favorites” /r /Y /E

(Obviously, I just used the …'s to save screen space…you’ll have to put in the entire Path names.)

That should do it…it’s untested, so if it breaks tell me, I’ll give it more time than just a quick glance.

BE SURE to use the quotes around your directory names, or else DOS will get confused-uh.

For further reference from a CMD window, you can type xcopy /?

What QED suggested will work,but with this you can write a Batch Script to do it using a simple double click, instead of having to open both folders and do the copy/paste junk every morning.

I’ll keep my eye on this thread, so tell me if it doesn’t work, or you have other questions.

HTH,
Steve

That’s what I’m doing now QED, not that it’s hard, but I’m lazy and just looking for a easy solution. I’ll try that tip Steve, let you know if it works, thanx :).

If Steve’s idea doesn’t work right, I can hash out a little DOS executable that will do the trick. I keep QuickBASIC around just for this sort of quick and dirty stuff.

Steve’s idea should work but I know you can do it using just the “copy” command. I just did it and I’m running 2000Pro. What I did not know and learned from Steve (thanks) was the use of the quotes around the targets.

COPY works fine if you don’t have any files in subdirectories. If you do, you need to use XCOPY.

hmmm…a bird… are you sure???

I just created a structure like this:

http://atlantasteve.blogspot.com/images/tree.gif

Then did this:
Copy “C:\Test\Test2*.*” “C:\Test\Test1”

The only result was that 1.txt and 2.txt were copied from Test2 into Test1. All the Subdirs (testx, testy, etc) and their files were left untouched. And my “Copy /?” showed no indication of a way to drill down into subdirs.

I’m on Win2000 Server, so we’re using the same CMD interpreter.

Steve

Steve suggestion did the trick, thanx for the heads up on xcopy. Works like a charm.

I’d take it a step further so that Second doesn’t have to delete the unwanted stuff first.

Start by renaming your backup directory to “Favorites”

DELTREE /y "Documents and Settings\jlarussa\Favorites "

cd “C:\Documents and Settings\jlarussa\My Documents”

XCOPY /i /s /e /y /r “Favorites” "C:\Documents and Settings\jlarussa\Favorites "
Jane

Whoops. I forgot the C: prompt in the DELTREE step. Should be:

DELTREE /y "C:\Documents and Settings\jlarussa\Favorites "

cd “C:\Documents and Settings\jlarussa\My Documents”

XCOPY /i /s /e /y /r “Favorites” "C:\Documents and Settings\jlarussa\Favorites "

Good suggestion AllShookDown. I was under the impression he had the delete stuff working, and was having problems working the (X)Copy command. But re-reading his post, I see that was not at all implied.

Thanks,

Steve