Batch file 要删除*.vcproj.*的批处理文件,例如code.vcproj.user1,但没有*.vcproj

Batch file 要删除*.vcproj.*的批处理文件,例如code.vcproj.user1,但没有*.vcproj,batch-file,vcproj,Batch File,Vcproj,如何编写批处理文件以仅删除VisualStudioFile(*.vcproj.),而不删除VisualStudioProject(*.vcproj)?这可以在cmd中交互运行: for %x in (*.vcproj.*) do if not "%~xx"==".vcproj" del "%x" 如果您想要一个批处理文件,那么您需要 for %%x in (*.vcproj.*) do if not "%%~xx"==".vcproj" del "%%x" 不过,这不会删除像blah.vcp

如何编写批处理文件以仅删除VisualStudioFile(
*.vcproj.
),而不删除VisualStudioProject(
*.vcproj
)?

这可以在
cmd
中交互运行:

for %x in (*.vcproj.*) do if not "%~xx"==".vcproj" del "%x"
如果您想要一个批处理文件,那么您需要

for %%x in (*.vcproj.*) do if not "%%~xx"==".vcproj" del "%%x"
不过,这不会删除像
blah.vcproj.vcproj
这样的文件。我不知道你的情况有多像