vbscript - vbs 脚本在桌面上显示文件和文件夹,但这没有运行并引发错误
问题描述
Set fso=CreateObject("Scripting.FileSystemObject")
DesktopPath=CreateObject("WScript.Shell").SpecialFolders("Desktop")
'Files count
msgbox "the no of files on the desktop is:"
&fso.GetFolder(DesktopPath).Files.count
'Folders count
msgbox "the no of folder on the desktop is:"
&fso.GetFolder(DesktopPath).SubFolders.count
解决方案
您应该在for break a line_
的注释末尾添加:MsgBox
Set fso=CreateObject("Scripting.FileSystemObject")
DesktopPath=CreateObject("WScript.Shell").SpecialFolders("Desktop")
'Files count
msgbox "The N° of files on the desktop is : "_
& fso.GetFolder(DesktopPath).Files.count
'Folders count
msgbox "The N° of folder on the desktop is : "_
& fso.GetFolder(DesktopPath).SubFolders.count
推荐阅读
- amazon-web-services - AWS OpenSearch 的 Apache Beam Java ElasticsearchIO 错误
- c# - C# .net core - 对内存缓存的依赖注入引用
- amazon-web-services - 将现有 AWS 机密引入 Cloud Formation 堆栈
- highcharts - Highcharts - SMA 指标不显示
- reactjs - React Konva 旋转/旋转动画
- c - 具有中断选项的功能的顺序执行
- typescript - 打字稿。定义函数对象的类型
- ruby - 无法使用没有 rails 的 mysql2 构建 gem 原生扩展
- github - 在 digitalocean droplet 这样的服务器上拥有私有 ssh 密钥以连接到 github 是否安全?
- html - 如果按钮被禁用,CSS 悬停