Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-11-19
3
Medium Priority
?
2,560 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
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…

885 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