views:

793

answers:

5

I am trying to run xcopy that copies files excluding .obj, etc. What I am seeing is that Microsoft.Practices.ObjectBuilder.dll is not copied when my excludes.txt file contains .obj as an extension. When .obj is removed, I Microsoft.Practices.ObjectBuilder.dll is copied correctly. This does not happen to other dlls though.

Does anyone have any idea why this would happen?

Thanks!

Lenik

+3  A: 

I guess because the substring .obj is found in the name Microsoft.Practices**.Obj**ectBuilder.dll and since windows is not case sensitive, it will exclude it.

André
thanks André! MS Doc contradicts what's actually happening:"If you specify the string ".obj", you exclude all files with the .obj extension."curious if there is a way to get around the issue...
Lenik
WHere are you copying from that you see .obj files?
leppie
I am copying from the root directory recursively -- I need to include .asmx, .configs etc, but I want to skip intermediate files.
Lenik
A: 

Well, the short answer is RTFM.

The longer answer is to give you what you could obtain by typing

xcopy /?

/EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively.

gizmo
@gizmo - to be fair to Lenik, from the xcopy /exclude help text I wouldn't have said RTFM made it any clearer, especially that last sentence which is being quite specific from my reading of it. "any part of the absolute path" does not necessarily equate to any part of filename.
Kev
Yeah great! So I'm being downvoted just because people are unable to understand a 5 lines explanation. Stackoverflow is getting worth and worth over time... and still in beta.
gizmo
+4  A: 
Hafthor
+3  A: 

XCOPY is deprecated now anyway, so I doubt things are going to get fixed. Take a look at ROBOCOPY - it's built into Vista, and comes in the resource kit for 2003 and XP.

Eclipse
A: 

ola pessoal, criei um lote de comandos no dos do xp capaz de fazer o backup de todos os documentos do usuario atual na maquina.

veja so: crie um arquivo de texto. ("unidade":Manager\manager.cmd) (so funciona nesse diretorio)

E dentro dele copie e cole o seguinte:

@echo off title Backup Tool, By David color f :inicio set choice=nada echo 1. Criar um Backup echo 2. Resturar um Backup echo Este program foi projetado para funcionar no Windows XP, e 100%% confiavel. set /p choice=Escolha uma opicao if %choice%==1 goto opi1 if %choice%==2 goto opi2 cls goto inicio

:fail echo ja existe pause cls goto inicio

:opi1 cls set unit=\ if exist "B:\Manager\manager.cmd" set unit=B: if exist "c:\Manager\manager.cmd" set unit=C: if exist "d:\Manager\manager.cmd" set unit=D: if exist "e:\Manager\manager.cmd" set unit=E: if exist "f:\Manager\manager.cmd" set unit=F: if exist "G:\Manager\manager.cmd" set unit=G: if exist "H:\Manager\manager.cmd" set unit=H: if exist "I:\Manager\manager.cmd" set unit=I: if exist "J:\Manager\manager.cmd" set unit=J: if exist "K:\Manager\manager.cmd" set unit=K: if exist "L:\Manager\manager.cmd" set unit=L: if exist "M:\Manager\manager.cmd" set unit=M: if exist "N:\Manager\manager.cmd" set unit=N: if exist "O:\Manager\manager.cmd" set unit=O: if exist "P:\Manager\manager.cmd" set unit=P: if exist "Q:\Manager\manager.cmd" set unit=Q: set /p folder=Qual o nome para a pasta? (digite sem espaco) md %unit%\%folder%\UnitC md %unit%\%folder%\Docs md %unit%\%folder%\Email md %unit%\%folder%\AreaDeTrab md %unit%\%folder%\PCNome echo %computername% >> \%folder%\PCNome\Nome.txt if exist %unit%\Manager\excluDocs.txt del %unit%\Manager\excluDocs.txt if errorlevel 1 goto fail rem copia os docs da maquina if exist "%userprofile%\My Documents" set docs="%userprofile%\My Documents" if exist "%userprofile%\Meus Documentos" set docs="%userprofile%\Meus Documentos" title Backup Tool, By David, Buckup Atual: Documentos :ext cls echo Restringir arquivos? echo 1 Arquivos de musica (.mp3, .wma, .wave, .wav) %mp3% echo 2 Arquivos de Imagens (.jpg / jpeg, .phg, .gif) %jpg% echo 3 Arquivos de Filme (.rmvb / rmv, .avi, .vob, .wmv) %avi% echo 4 Arquivos executaveis (.exe, .msi) %execut% echo 5. Continuar set /p extcho=Digite o num. das extencoes que voce NAO quer incluir
if "%extcho%"=="1" goto extmp3 if "%extcho%"=="2" goto extjpg if "%extcho%"=="3" goto extavi if "%extcho%"=="4" goto exec if "%extcho%"=="5" goto copydocs goto ext

rem opi 1 :extmp3 echo .mp3 >> %unit%\Manager\excluDocs.txt echo .wav >> %unit%\Manager\excluDocs.txt echo .wave >> %unit%\Manager\excluDocs.txt echo .wma >> %unit%\Manager\excluDocs.txt set mp3=Nao Incluir! goto ext

rem opi 2 :extjpg echo .jpg >> %unit%\Manager\excluDocs.txt echo .jpeg >> %unit%\Manager\excluDocs.txt echo .png >> %unit%\Manager\excluDocs.txt echo .gif >> %unit%\Manager\excluDocs.txt set jpg=Nao Incluir! goto ext

rem opi 3 :extavi echo .avi >> %unit%\Manager\excluDocs.txt echo .rmvb >> %unit%\Manager\excluDocs.txt echo .rmv >> %unit%\Manager\excluDocs.txt echo .vob >> %unit%\Manager\excluDocs.txt echo .wmv >> %unit%\Manager\excluDocs.txt set avi=Nao Incluir! goto ext

rem opi4 :exec echo .exe >> %unit%\Manager\excluDocs.txt echo .msi >> %unit%\Manager\excluDocs.txt set execut=Nao Incluir! goto ext

rem opi 5, comeca a copia :copydocs if exist %unit%\Manager\excluDocs.txt xcopy /h /e /v /exclude:excluDocs.txt %docs%*.* %unit%\%folder%\Docs if not exist %unit%\Manager\excluDocs.txt xcopy /h /e /v %docs%*.* %unit%\%folder%\Docs if errorlevel 1 goto docserror

rem copia a c: goto copyc :docserror cls color c echo Houve erros na copia dos arquivos em Documentos! Por favor verifique os arquivos! echo Talvez pode ser problemas na leitura do disco ou possiveis virus! echo O pragrama proseguiu com a copia dos outros arquivos, echo Mas verifique, pode estar faltando arquivos no Backup! pause cls

:copyc title Backup Tool, By David, Buckup Atual: %homedrive% if exist %unit%\Manager\excluDocs.txt xcopy /h /e /v /exclude:exclu.txt+excluDocs.txt %homedrive%*.* %unit%\%folder%\UnitC if not exist %unit%\Manager\excluDocs.txt xcopy /h /e /v /exclude:exclu.txt %homedrive%*.* %unit%\%folder%\UnitC if errorlevel 1 goto cerror

goto copyareat :cerror cls color c echo Houve erros na copia dos arquivos em %homedrive%! Por favor verifique os arquivos! echo Talvez pode ser problemas na leitura do disco ou possiveis virus! echo O pragrama proseguiu com a copia dos outros arquivos, echo Mas verifique, pode estar faltando arquivos no Backup! pause cls

:copyareat title Backup Tool, By David, Buckup Atual: Area de Trabalho if exist %unit%\Manager\excluDocs.txt xcopy /e /v /exclude:excluDocs.txt "%userprofile%\Desktop*." %unit%\%folder%\AreaDeTrab if not exist %unit%\Manager\excluDocs.txt xcopy /e /v "%userprofile%\Desktop*." %unit%\%folder%\AreaDeTrab if errorlevel 1 goto areaterror

goto email :areaterror cls color c echo Houve erros na copia dos arquivos na Area de Trabalho! Por favor verifique os arquivos! echo Talvez pode ser problemas na leitura do disco ou possiveis virus! echo O pragrama proseguiu com a copia dos outros arquivos, echo Mas verifique, pode estar faltando arquivos no Backup! pause cls

:email if exist %unit%\Manager\excluDocs.txt del %unit%\Manager\excluDocs.txt title Backup Tool, By David, Buckup Atual: Email cls echo Nao ha suporte para backup de e-mails, abra a programa cliente de echo e-mail e salve os arquivos nessa pasta. echo Notas: Se for preciso salve dados em Arquivos de programas; echo O backup e feito somente do usuario que esta logged in atual, echo caso deseja fazer Backup de outros usuarios, tera que estar entrar echo na conte referente, e rodar este pragrama, ou se preferir manulmente. echo Se as letras estiverem vermelha, verifique o Backup feito agora, pois echo pode estar faltando arquivos! echo Estamos terminando aqui. echo Creditos a David pause start %unit%\%folder%\Email

exit :opi2 start \ exit

Depois faca outro arquivo de texto dentro do mesmo diretorio(exclu.txt) (so funciona com esse nome)

E dentro dele coloque este texto: AUTOEXEC.BAT Bootfont.bin NTDETECT.COM MSDOS.SYS pagefile.sys hiberfil.sys IO.SYS CONFIG.SYS boot.ini ntldr \RECYCLER\ \Documents and Settings\ \Program Files\ \Arquivos de Programas\ \WINDOWS\ \System Volume Information\

E pronto! Dai vc pode fazer backup das maquinas sem esquentar a cabeca. Isso e muito bom pra quem trabalha com maquinas de clientes, como eu. boa sorte!