删除目录vb6中的所有文件 [英] Delete all files within a directory vb6

查看:666
本文介绍了删除目录vb6中的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以帮助我一个vb6函数,删除目录中的所有文件(不包括子目录)。

解决方案

一行,使用VB6语句杀死

 杀死c:\doomed_dir\ *。*



帮助主题说明在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中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆