【问题标题】:MS-DOS delete with wildcards on ends带通配符的 MS-DOS 删除
【发布时间】:2012-02-07 10:29:10
【问题描述】:

我想要的是一个通配符,意思是“包含” 所以如果我有一个带有

的目录
a.txt
b.param
b.param.config

我只想删除 b.param 和 b.param.config

我尝试过del *.param*、del *param* ...但文件的开头和结尾似乎没有任何内容匹配,但包含 param。

我正在从批处理文件运行命令,所以如果解决方案是批处理的,那也可以。

【问题讨论】:

  • 也许这会有所帮助:stackoverflow.com/questions/2556778/…
  • 看到那个...不适用,因为我无法删除目录中的 EVERYTHING
  • 我试过了,我承认我有一段时间没用过DOS了!

标签: batch-file wildcard dos


【解决方案1】:

我认为 del *param* 应该适用于此...

c:\test>dir /w
 Volume in drive C is HP
 Volume Serial Number is 0EBF-B242

 Directory of c:\test

[.]              [..]             a.txt            b.param
b.param.config
               3 File(s)             29 bytes
               2 Dir(s)  185,518,833,664 bytes free

c:\test>dir /w *param*
 Volume in drive C is HP
 Volume Serial Number is 0EBF-B242

 Directory of c:\test

b.param          b.param.config
               2 File(s)             20 bytes
               0 Dir(s)  185,518,833,664 bytes free

c:\test>del *param*

c:\test>dir /w
 Volume in drive C is HP
 Volume Serial Number is 0EBF-B242

 Directory of c:\test

[.]     [..]    a.txt
               1 File(s)              9 bytes
               2 Dir(s)  185,518,833,664 bytes free

当你尝试这个时发生了什么?你运行的是什么版本的 MS-DOS?

【讨论】:

  • 我拼错了中间字符...该回家过夜了。大声笑
猜你喜欢
  • 1970-01-01
  • 2022-11-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多