Solved

VBS Script to copy Favorites & Outlook NK2 file to DFS network share

Posted on 2007-11-19
3
2,536 Views
Last Modified: 2010-09-07
I'd like to create 2 VBS scripts to handle copying our users' Favorites and Outlook nk2 file from their local computer C:\Documents and Settings\%username%\Favorites\* and C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\*.nk2 to a DFS Share \\domain.net\data\userdata\%username%\Favorites and \\domain.net\data\userdata\%username%\Outlook.

Our users don't have a User drive mapped, we just use folder redirection for their My Documents and Desktops.  

I'd like to have a script run at logoff that copies all the necessary files to their %userdata% folder on the DFS share and at login copy the data back down to the workstation.  Ultimately I'd like to have folder redirection for the .nk2 file and favorites.  I can handle re-working the script to modify the source and destination, but I'm having trouble figuring out how to script the %username% variable in my testing scripts.  

Thanks for your help!

0
Comment
Question by:hh_techservices
3 Comments
 
LVL 2

Accepted Solution

by:
t_taylor earned 500 total points
ID: 20313610
I may be missing something but why make this vbs?  It is about a 2 line bat file.

copy C:\Documents and Settings\%username%\Favorites\  \\domain.net\data\userdata\%username%\Favorites /y

And it will work the same for the other files and just switch dest and origin for logon script.  You may want to use /v in order to make sure that the copy is correct, thought it will probably take a noticeable amount longer. Note the script is one line, just split in two above to fit on the screen.
0
 
LVL 1

Author Comment

by:hh_techservices
ID: 20313732
no real reason.. I already have something working with a batch script, but I have been migrating all of our scripts from batch to VBS.

The files that are being copied are not going to be over 1Mb so /v shouldn't take that much longer.  Thanks for the advice!

0
 
LVL 3

Expert Comment

by:gilm0079
ID: 24023185
FYI, UNC paths are not supported via the batch file method.  When GP executes the .bat logon script it uses CMD.EXE.  It then errors out with "The system cannot find the path specified".  As far as I can tell you can't access UNC paths when running copy from CMD.exe.  I would also suggest using vbscript.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question