Link to home
Start Free TrialLog in
Avatar of hh_techservices
hh_techservicesFlag for United States of America

asked on

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

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!

ASKER CERTIFIED SOLUTION
Avatar of t_taylor
t_taylor

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 hh_techservices

ASKER

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!

Avatar of gilm0079
gilm0079

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.