我有以下代码:
@echo off
cd %temp%
rd /s /q svnbackup >nul 2>&1
md svnbackup\uncomitted_db-pc
cd svnbackup\uncomitted_db-pc
type NUL>files.txt
for /F "tokens=1*" %%T in ('svn status C:\SVN-EDGE') do ( echo %%U>>files.txt && xcopy "%%U" . /E /S /I /F /H /K /X /Y /R )
我得到以下输出files.txt
:
C:\SVN-EDGE\SomeClient\BUTCHERED.docx
C:\SVN-EDGE\SomeClient\Development notes.txt
C:\SVN-EDGE\SomeClient\Received\~$formation for prospective clients.docx
C:\SVN-EDGE\SomeClient\Sales\Estimates.xlsx
C:\SVN-EDGE\SomeClient\Sales\Specification.docx
C:\SVN-EDGE\SomeClient\Sales\~$Estimates.xlsx
C:\SVN-EDGE\SomeClient\Sales\~$ecification.docx
C:\SVN-EDGE\SomeClient\removed.docx
C:\SVN-EDGE\SomeClient\site spec1.docx
C:\SVN-EDGE\SomeClient\~$TCHERED.docx
C:\SVN-EDGE\SomeClient\~$emoved.docx
C:\SVN-EDGE\SomeClient\~$te spec1.docx
但问题是,xcopy 在里面创建Received
andDevelopment
文件夹,然后将相关文件放在无论如何%temp%\svnbackup\uncomitted_db-pc
的顶层。%temp%\svnbackup\uncomitted_db-pc
任何时候都不会创建SVN-EDGE
或SomeClient
创建文件夹。如何确保创建了这些文件夹,并将上面单独列出的输入 xcopy 的文件放入正确的子目录中?