【发布时间】:2018-04-17 16:49:58
【问题描述】:
我希望从当前用户的计算机中删除 OfficeFileCache 文件夹。目前我有..
Option Explicit
Dim obj : Set obj =CreateObject ("wscript.shell")
Dim fso : Set fso =CreateObject ("scripting.FileSystemObject")
obj.Run "taskkill /f /im msouc.exe.exe",0
obj.Run "taskkill /f /im msosync.exe.exe",0
fso.DeleteFolder "C:\Users\%username%\AppData\Local\Microsoft\Office\16.0\OfficeFileCache"
最后一部分是我遇到的麻烦。只是在 VB 脚本中寻找与用户名等效的内容。
【问题讨论】:
-
简单地说:
fso.DeleteFolder obj.ExpandEnvironmentStrings("C:\Users\%username%\AppData\Local\Microsoft\Office\16.0\OfficeFileCache")
标签: vbscript