返回列表 发帖

[原创] vbs文件守护

vbs代码(文件守护.vbs):
On Error Resume Next
dim wmi,proc,procs,proname,flag,WshShell,fso,f
set fso=CreateObject("Scripting.FileSystemObject")
set WSHshell = wscript.createobject("wscript.shell")
set f=fso.opentextfile("X.tmp",8)
Do
    proname="cmd.exe"
set wmi=getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")  
set procs=wmi.execquery("select * from win32_process")   
  flag=true  
for each proc in procs  
    if strcomp(proc.name,proname)=0 then  
     flag=false   
      exit for   
    end if  
next   
  set wmi=nothing  
  if flag then  
    WshShell.Run "进程保护.bat",0,true  
end if   
loop COPY
bat代码(进程保护.bat):
@echo off
set a=文件保护.vbs
:loop
tasklist|find /i "wscript.exe" ||start %a%>nul
goto loopCOPY
下载链接:https://wwm.lanzouq.com/i19J108c5cmf
https://pc.woozooo.com/mydisk.php

返回列表