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

x
?
Solved

Creating a Bat File

Posted on 2008-06-13
6
Medium Priority
?
320 Views
Last Modified: 2010-04-21
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
0
Comment
Question by:gd6627
6 Comments
 
LVL 10

Expert Comment

by:MoreHeroic
ID: 21782020
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
 
LVL 10

Assisted Solution

by:MoreHeroic
MoreHeroic earned 600 total points
ID: 21782031
Looks like I had an extra space in there:

xcopy /e /v /y "C:\Documents and Settings\User" \\NTSERVER\NTServerC\Backup
0
 
LVL 2

Accepted Solution

by:
mav11rick earned 1400 total points
ID: 21782076
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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 7

Expert Comment

by:CorruptedLogic
ID: 21782102
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
 

Author Closing Comment

by:gd6627
ID: 31467064
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
 
LVL 2

Expert Comment

by:mav11rick
ID: 21782584
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

916 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