Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move multiple folders with same name? 1

Status
Not open for further replies.

Jontmke

MIS
May 25, 2001
1,022
US
Here is the situation:
About a year ago we moved from Pegasus mail to Outlook[sadeyes]. No problems there. Now, I am running out of room on my main file server where the users home directories are located. I want to move the pmail directory that is in every users home directory off that server.

I can not move the entire users directory because that is where all there other junk is at.

I tried to do a find and then a cut and paste for the pmail directories, but of course they all have the same name (pmail), so that won't work. (doh![tongue])

I can not just delete them for legal reasons, but if I can move them off I will get 18Gigs of space back!


Any ideas? Some xcopy or ncopy switch maybe?

Thanks in Advance,
JON
 
I would setup a mapping in the login script to map U to that users home directory. Then you can add a batch file to the login directory to copy the file from U to another area. I have not tried this but it would also be nice to rename the file so that the user login ID is attached to the name of the file so you know who it belongs to at a later time. It will also prevent the file to overwrite itself when the next person logs in.

If this works then modify the scipt to delete the file after you have them all safely stored elsewhere.

- Zych
 
Hmm... that gives me an idea. Thanks.
I'll let you know what happens.

JON
 
I figured it out!!![bigsmile]
OK, this is what I did.
This batch moves the PMAIL directory and renames it to the users Login Name in Novell.

Our user directories already map to H:.
So, I made a batch that will look for any file in the directory, doesn't matter. I only need to know it's there. I tried to do this but it did not seem to work:

IF EXIST H:\PMAIL\NUL MOVE...
The NUL is supposed to indicate a directory, but maybe I did not use the correct syntax. So, I used this:

IF EXIST H:\PMAIL\*.* GO TO MOVE
IF NOT EXIST H:\PMAIL\*.* GO TO NOPMAIL

:MOVE
MOVE H:\PMAIL F:\OLDPMAIL\%LOGIN_NAME%
GOTO END

:NOPMAIL
ECHO NO PMAIL DIRECTORY
GOTO END

:END
EXIT

Notice the ending % sign? Even though Novell needs only the preceding sign, Windows wants both.
So, if anybody needs to do this in Novell, here is an example.

JON
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top