Creating a Bat File

Need to createn a BAt file or a VB script to copy user dat from local PC to Network drive folder.
I like to grab everything under  C:\Documents and Settings \User and copy it to a network share
gd6627Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mav11rickConnect With a Mentor Commented:
I use this below personally on my laptop.  H; drive being my mapped network drive.

@echo off
:: variables
set drive=H:\Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"

echo ### Backing up Favorites...
%backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"


:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

echo Backup Complete!
@pause
0
 
MoreHeroicCommented:
Change \\NTSERVER\NTServerC\Backup to the UNC path of your network location:


xcopy /e /v /y C:\Documents and Settings \User \\NTSERVER\NTServerC\Backup
0
 
MoreHeroicConnect With a Mentor Commented:
Looks like I had an extra space in there:

xcopy /e /v /y "C:\Documents and Settings\User" \\NTSERVER\NTServerC\Backup
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
CorruptedLogicCommented:
FYI, you can also use the Files and Settings Transfer wizard (Accessories > System Tools > Files & Settings transfer wizard). If, that is, you want to transfer a user profile from one place to another.
0
 
gd6627Author Commented:
Thanks gentlemen for your assitance :
Moreheroic: your advice  would work for a fast solution ..Thank you

mav11rick: your advice is well detailed this will work perfect for me and this situation . what are the different switches for  xcopy command and how does it grab the different user profiles if i log in as admin to the local PC
0
 
mav11rickCommented:
for a quick overview of the swithes type "xcopy /?" from the command prompt.

The batch file i gave you is setup to automatically grab the current users folder.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.