Link to home
Start Free TrialLog in
Avatar of mcrmg
mcrmg

asked on

Batch file for backing up

Hi,

I am trying to write a batch file that can backup outlook.pst to somewhere, but I would like to just keep bk files for the past 3 days......is that doable??  Thnaks
ASKER CERTIFIED SOLUTION
Avatar of K_2K
K_2K

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcrmg
mcrmg

ASKER

I put this , and it is not working


set zpst=name\Local Settings\Application Data\Microsoft\Outlook\outlook.pst
set zbk=name\Outlook PST Backup Folder

%userprofile%  should be a preset value pointing to the folder for the user that runs the command,  so each user can run the same script and it affects their own folder.

%TEMP% is also wherever that user chooses to keep temp files, although I recommend changing it to a network drive that is non-temporary for the user.


Are you trying to run this for each user instead of them running it for themself?

Have you created the folder called "name" ?
Avatar of mcrmg

ASKER

working....

thank you very much
Also check to make sure your system is set to keep the pst in that folder.  If the one in your =%userprofile%\Local Settings\Application Data\Microsoft\Outlook folder is dated to show the last time you checked mail, that should be confirmation enough.
You're welcome.

Be sure to note that %TEMP% could be cleaned out by a user at any time,  

I'd prefer to change to something like this, but you'd have to put in your own network information:

net use K: /delete >nul 2>&1
net use K:  \\server\private_share
set zbk=K:\Outlook PST Backup Folder


K: has to change to a drive letter you're not using, or take out the "net use" commands and change K: to one that's known already mounted for each user.

server has to change to the name of your file server.
private_share has to change to the name of a share set up on that server that is private to the user.   Many administrators use %USERNAME% for this the same scripts can still be used for each user.  

*************************
BE SURE to check permissions on those shares to be private to the user !!
*************************

Folks get a little miffed when I put copies of their mail where other folks can read it.  That's why i make it more work to do it that way, so the permissions will hopefully be checked.

My 2¢,
2K
(\o/)
Avatar of mcrmg

ASKER

can you explain a little about this:


net use K: /delete >nul 2>&1
net use K:  \\server\private_share


Thanks....
These do not apply unless you are connected to a LAN.  
Your system administrator or network administrator should be able to supply you with the following:

server= Network name of a server that has files shared for each user.
private_share= Network name of each user's private space on that server.  

Make sure she/he understands this should not be visible by other users. If he is setting these up for you for the first time, ask that he make each user's name be part of the sharename if possible, so if my public share everyone can see is \\server\2K\ because my %USERNAME% is 2K, then my private share might be \\server\prv2K.  The mount command would become

net use K:  \\server\prv%USERNAME%


K: = your administrator should be able to tell you a drive letter that is not used in anyone's logon file mounts so you can use the net use commands to mount the drives.  
Better still, he may have one automatically mounted for you so you don't need to know anything but the drive letter.  Then you should not need any "net use" commands, just plug in the drive letter.
Enter this at a command prompt for more information:
     net help use

Good Luck,
2K
(\o/)