Question Locked

Move Multiple User shares

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am doing some cleanup of our users shares folder and need to move some user folders and subfolders to a different directory. I have the usernames separated by comas in a text file. I have created a batch file which works for xcopy but not move. It is a windows 2000 server
here is the script i am using

for /F "delims=," %%i in (D:\moveutils\Users.txt) do move "D:\users\%%i\*.*" "D:\Disabled User Archive\%%i" /e /s

can anyone help...

3 replies

by kenone

What do you need help with? Copy the files to the new location, change the permissions on the old location so that only the admin has access. Let the dust settle, wait, wait, wait. Okay now delete the old locations folders.

by Member 25348569

You need the destination folder to exist if I remember correctly. Xcopy doesn't - and will, as a default, automatically create a target folder if copying multiple files.

Run the loop twice, first to md "D:\Disabled User Archive\%%i"

Or why not just move the entire folder? That will take everything across in a couple of seconds.

for /F "delims=," %%i in (D:\moveutils\Users.txt) do move "D:\users\%%i" "D:\Disabled User Archive\"

Neil :)

This discussion is closed to new replies.