Backup win7 profile error logs

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
challengerRT
Posts: 2
Joined: 30 Jun 2011 10:24

Backup win7 profile error logs

#1 Post by challengerRT » 30 Jun 2011 12:34

I want to backup an Errors folder that is contained in each user profile for about 40 computers and an unknown number of users. I am new to this and would appreciate it if someone can point me in the right direction. It is the %username% variable that eludes me. How can I get it to backup the errors folder for multiple profiles without specifying a username?

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

%backupcmd% "\\testcomp1\C$\Users\%username%\AppData\Roaming\prog1\SiteFiles\Errors" "%drive%\testcomp1 - prog1 Errors"


echo Backup Complete!
@pause

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Backup win7 profile error logs

#2 Post by Cleptography » 30 Jun 2011 12:37

This has no relevance to your question but I am just curious. Are you a sysadmin?

challengerRT
Posts: 2
Joined: 30 Jun 2011 10:24

Re: Backup win7 profile error logs

#3 Post by challengerRT » 30 Jun 2011 12:42

I do work in IT but not really a sys admin. Just trying to gather some data and fix some issues.

Post Reply