Solved

Creating a Bat File

Posted on 2008-06-13
6
315 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 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

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 …
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

803 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