如何查看C盘剩余空间以及c:\123文件夹大小。并输出文本。
VBS脚本,只能查看c:\123文件夹大小。无法查看C盘的空间。继续求帮助。- Function format_size(size)
- On Error Resume Next 'For Log(0)
- sizes = array(" Bytes", " KB", " MB", " GB", " TB", " PB")
- i = Int(Log(size) / Log(1024))
- format_size = Round(size / 1024 ^ i, 2) & sizes(i)
- End Function
-
- 'Example
- Set fso = CreateObject("Scripting.FileSystemObject")
- size = fso.GetFolder("c:\123").Size
- WScript.Echo format_size(size)
复制代码 [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
感谢大家帮助。远程重启打印服务已经完美解决了- ::远程禁用启用打印服务(一)
- sc \\192.168.0.121 stop Spooler
- sc \\192.168.0.121 start Spooler
-
- ::远程禁用启用打印服务(二)
- wmic /node:192.168.0.121 /user:"administrator" /password:"123123" service where "name='Spooler'" call stopservice
- wmic /node:192.168.0.121 /user:"administrator" /password:"123123" service where "name='Spooler'" call startservice
-
- ::删除打印任务
- DEL \\192.168.0.121\c$\WINDOWS\system32\spool\PRINTERS\*.* /F /Q
复制代码
|