Solved

Creating a Bat File

Posted on 2008-06-13
6
313 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 7

Expert Comment

by:CorruptedLogic
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now