I use a batch program to pull the My Documents from all the users on my domain. The batch file is ran by a Scheduled Task that happens every weekday at noon.
This is what the bacth files looks like:
[backup.bat]
---BEGIN---
@ECHO ON
date >> d:\users\log\blog.txt < d:\users\log\enter
time >> d:\users\log\blog.txt < d:\users\log\enter
rem 1
set USER=ACCOUNTING
set DRIVE=C$
set DIR=MYDOCU~1
call d:\users\program\bkdocu.bat
rem 2
...
---END---
[bkdocu.bat]
---BEGIN---
echo %USER%
@echo %USER% >> d:\users\log\blog.txt
If not exist \\%user%\%drive%\%dir% echo PROBLEM error 1 !!!!!! >> d:\users\log\blog.txt
if not exist d:\users\%user% md d:\users\%user%
XCOPY \\%user%\%drive%\%dir%\*.* d:\users\%USER% /s /e /c /d /l /f >> d:\users\log\blog.txt
XCOPY \\%user%\%drive%\%dir%\*.* d:\users\%USER% /s /e /c /d
---END---
Now the problem I am experiencing is that the batch will sometime prompt me?!? It will ask if it can overwrite (Yes/No/All). The bacth just waits there and I have to be there to type A for ALL. Now I tried to use the /um in the Task Manager to make it an un-attended task but no success. Can someone please look at my XCOPY command andtell me if there is something wrong. I want to be able to copy only files that are new or that have been modified.
Regards,
J.F.D.
This is what the bacth files looks like:
[backup.bat]
---BEGIN---
@ECHO ON
date >> d:\users\log\blog.txt < d:\users\log\enter
time >> d:\users\log\blog.txt < d:\users\log\enter
rem 1
set USER=ACCOUNTING
set DRIVE=C$
set DIR=MYDOCU~1
call d:\users\program\bkdocu.bat
rem 2
...
---END---
[bkdocu.bat]
---BEGIN---
echo %USER%
@echo %USER% >> d:\users\log\blog.txt
If not exist \\%user%\%drive%\%dir% echo PROBLEM error 1 !!!!!! >> d:\users\log\blog.txt
if not exist d:\users\%user% md d:\users\%user%
XCOPY \\%user%\%drive%\%dir%\*.* d:\users\%USER% /s /e /c /d /l /f >> d:\users\log\blog.txt
XCOPY \\%user%\%drive%\%dir%\*.* d:\users\%USER% /s /e /c /d
---END---
Now the problem I am experiencing is that the batch will sometime prompt me?!? It will ask if it can overwrite (Yes/No/All). The bacth just waits there and I have to be there to type A for ALL. Now I tried to use the /um in the Task Manager to make it an un-attended task but no success. Can someone please look at my XCOPY command andtell me if there is something wrong. I want to be able to copy only files that are new or that have been modified.
Regards,
J.F.D.