Solved

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

Posted on 2007-11-19
3
2,541 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

763 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