我想知道是否有辦法讓它成爲我的vbs腳本可以檢查並刪除某個單詞的任何文件在它的名字。這是我到目前爲止有:使VBScript檢查文件名稱中包含某個單詞的文件,然後查找並刪除該文件
x=MsgBox ("Searching for any infected files...",64,"Search")
DIM filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("C:\Documents and Settings\Name\Desktop\example.txt") Then
WScript.Sleep 1500
x=MsgBox ("Warning! A infected file was found!",48,"Warning")
filesys.DeleteFile "C:\Documents and Settings\Name\Desktop\example.txt"
x=MsgBox ("File was deleted!",48,"File Deleted")
WScript.Sleep 1000
x=MsgBox ("This Computer is now clean!",64,"Hooray!")
Else
WScript.Sleep 500
x=MsgBox ("File not found! This Computer is clean!",64,"Hooray!")
End If
有也是一種方式,使任何一臺計算機上的用戶名/文件路徑的工作?我知道這是
"C:\Documents and Settings\%username%\Desktop\example.txt"
批處理,但有沒有類似的VBScript?是否還有一種方法可以刪除名稱中包含「示例」的任何擴展名的文件?例如:
filesys.DeleteFile "C:\Documents and Settings\Name\Desktop\example.anyextension"
非常感謝!我希望你不介意我的大量問題,我只是開始用VBS/VBScript編寫代碼,非常感謝你的幫助! :)
我想你想寫一些像清潔劑,所以你可以從這裏得到靈感==> http://stackoverflow.com/questions/23832414/how-to-move-file-while-renaming-it-與-遞增-IF-的文件,存在功能於VBS – Hackoo