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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file to copy to server with users logged off

Status
Not open for further replies.
Oct 7, 2007
6,597
US
Here's what I'm trying to do. Copy the Outlook files off workstations to the 2003 server for backup purposes (no Exchange involved, just stand-alone Outlook).

So, I want to copy the contents of the outlook folder to the server in the following location:
\\server\share\mailbackup\username

I want it to be able to run as a scheduled task AND regardless of whether the user is logged ON or OFF. So I guess I need to map a drive IN CASE the user is logged off. That's where I'm getting confused - whether you can map a network drive with the user logged off or if I should be using the \\ to address the server. If the user were to remain logged on, there would already be a mapped drive, but I don't want users remaining logged on, so it must work whether or not they are logged on or off.

Assuming that the user is logged off - am I on the right track here??



@echo on

net use x: "\\server1\shared\" /persistent:yes

rem copy the backup to the server
xcopy "C:\Documents and Settings\user\Local Settings\Application Data\Microsoft\Outlook\*.*" "x:\mailbackup\user1" /y

rem release mapped drive
net use x: /d /y

rem exit the batch file
exit
 
Right - I knew that (need to close Outlook), but I can't stand over them to make sure they do it.

I'll try the simple batch file first and then move on to the wrongly-maligned-by-me tool from Microsoft that CAN back up to a server.

That script from GrimR blows me away - too complicated for what I'm trying to do. Honestly, I don't even know what it is (visual basic??).
 
goomb,

If you use the backup utility that gets installed in Outlook, that GrimR mentioned earlier (at least I think that's who did.. didn't doublecheck).. it doesn't have to close outlook... or maybe it actually runs at close, not sure..

anyway, give it a try and let us know how it works out..

I've used it myself before with much success in diff environments..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top