Solved

Creating a Bat File

Posted on 2008-06-13
6
318 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
[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
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 150 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 350 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 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