hh_techservices
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%\Favori tes\* and C:\Documents and Settings\%username%\Applic ation Data\Microsoft\Outlook\*.n k2 to a DFS Share \\domain.net\data\userdata \%username %\Favorite s 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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER
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!