Batch move

Made myself / Made myself
Ravey Dave January 25, 2009 at 15:45:40
Specs: Windows XP, athlon xp 1800 /
I have problem with a batch file. I'd like to do this, but can't.

move *.* ..\newdir

overwriting existing.

I've tried
xcopy *.* ..\newdir
rd *.*
but does not work...!

Any ideas ?

Ravey Dave

See More: Batch move

Report •

January 25, 2009 at 16:22:42
move /y *.* ..\newdir


It seemed to work fine for me....

Report •

January 30, 2009 at 18:00:24
I need to move nested directories. This only works for files....! Thanks for your input, anyway..

Report •

January 30, 2009 at 18:58:43
Ok what about:

xcopy drive:\path\olddir drive:\path\newdir /i /s /h /w /v /g /k /x /-y
rd /s olddir

I went nuts with all the xcopy options that I think *could* be of some use in you situation. See xcopy /? for more info(start>run>cmd>xcopy /?).

I assume no responsibility for lost data, back up first....

Report •

Related Solutions

February 1, 2009 at 11:17:11
Copying the files isn't the problem, removing the directories after the copy is what I'm stuck on. What I could do with is a deltree command in XP...!

Thanks for your help Ravey Dave.

Report •

February 1, 2009 at 23:43:04
That's what the /s switch is on the rd command, it is the equivalent to deltree.

rd /?

Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a director

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

Report •

February 2, 2009 at 16:15:54
The problen with RD is that you have to specify the directory you need to delete, You can't use wildcards.
Maybe I should have provided more info to start with...!

What I have is:
On my file server I have two directories
AUDIO which is writable only by the server admin account, which is then used by my kids, read only, for their music.

Audio_TEMP which is world writable, but not used by my kids. When I rip my cd's I put them in the AUDIO_TEMP directory, and I want a bat file to run at scheduled times to move the contents from the AUDIO_TEMP directory to the AUDIO directory. Deleteing the contents when the copy is finished. As I don't know what the directory names are I can't specify them..

I'm not being rude, and I really appreciate your help in this matter.

Ravey Dave..

Report •

February 2, 2009 at 23:16:15
[edit: forgot to add the /d switch to match directories]

Don't worry I didn't think you were rude, just though you may have missed it.

It may be possible to use a for loop to add wildcards to the rd command:

for /d %%a in ("w?ld card dir*") do rd /s "%%~fa"

If needs be the directory name can be made up from a variable. The double quotes are only nessacery if the directory name contains a space or an ampersand.

If you need anymore help with this script just ask; don't worry I won't flame you ;).

Report •

February 3, 2009 at 15:07:39
My problem has been solved....!
I stupidly relied on information given to me by work mates, people who's only experience of computers is playing World of Warcraft, that Dos7/Win98 DELTREE would not work with WinXP. How wrong they were, I tried it, it worked.

Anyway thanks for all the help. I have decided I will lurk this forum, and maybe poke my head in from time to time, maybe we'll communicate again some day.

Again thanks a lot.

Ravey Dave.

Report •

Ask Question