Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何编写批处理文件以*.vcproj.*仅删除 VisualStudioUserFile()而不删除 VisualStudioProject(*.vcproj)?
*.vcproj.*
*.vcproj
这可以以交互方式运行cmd:
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的文件。我不知道在你的情况下这些可能性有多大。
blah.vcproj.vcproj