问题描述
我想知道是否有人可以帮助我一个vb6函数,删除目录中的所有文件(不包括子目录)。
一行,使用VB6语句在Microsoft Windows中,Kill支持使用多字符(*)和单字符(?)通配符来指定多个文件。
另外 - 我宁愿避免Microsoft脚本运行时(包括FileSystemObject)。根据我的经验,在用户机器上偶尔会出现这种情况,这可能是因为他们的IT部门对病毒的偏执。
I was wondering if anyone could help me with a vb6 function that would delete all files within a directory (excluding subdirectories).
One line, using the VB6 statement Kill
Kill "c:\doomed_dir\*.*"
The help topic says "In Microsoft Windows, Kill supports the use of multiple-character (*) and single-character (?) wildcards to specify multiple files".
As an aside - I prefer to avoid the Microsoft Scripting Runtime (including FileSystemObject). In my experience it's occasionally broken on user machines, perhaps because their IT department are paranoid about viruses.
这篇关于删除目录vb6中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!