Solved

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

Posted on 2007-11-19
3
2,530 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now