您的位置:首页 > 运维架构 > Shell

关于Shell.Application对象的一些简单尝试

2010-09-07 15:00 267 查看
Set shellapp = CreateObject("Shell.Application")

'获取所有桌面的窗口:

Set oWindows = shellapp.Windows

'执行文件:

shellapp.ShellExecute("ipconfig.exe","/all")

shellapp.ShellExecute("notepad.exe")

'创建子文件夹:

sDir= "c:/automation"

set oFolder = shellapp.NameSpace(sDir)

oFolder.NewFolder("Newfolder")

'获取文件夹内容信息:

set oitems = oFolder.items
For each oitem in oitems
print oitem.name
Next

'以资源管理器的形式浏览指定的文件夹内容

shellapp.Explore "c:/automation"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: