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"
本文介绍使用VBScript实现自动化任务的方法,包括执行程序、创建文件夹、浏览文件夹内容等。通过具体代码实例展示了如何利用Shell.Application对象进行桌面级自动化。

2万+

被折叠的 条评论
为什么被折叠?



