⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page307.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Dim objService, objWMIFiles, nResult, objFile

'get a reference to a WMI service
Set objService = GetObject("winmgmts:{impersonationLevel=impersonate}")

'get all files with .tmp extenstion on the C: drive
Set objWMIFiles = _
objService.ExecQuery ("Select Name From CIM_DataFILE Where " & _
                             "Drive='C:' And Extension='tmp'")
'loop through all files and attempt to delete them
For Each objFile In objWMIFiles
    nResult = objFile.Delete
    If nResult <> 0 Then
      WScript.Echo "*Unable to delete " & objFile.Name
    Else
      WScript.Echo "Successfully deleted file:" & objFile.Name
    End If
Next

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -