本文参考“一个常见U盘病毒的源码解读”
https://blog.csdn.net/hzh_csdn/article/details/79427001
vbs不区分大小写
如下面的代码,
on error resume next’出错继续往下执行
dim ws,objws,objFile
set ws = wscript.CreATeobject(“wScript.shell”)
Target="\1"
strPath=wscript.scriptfullname
Set objws=createobject(“scripting.filesystemobject”)
Set objfile=objws.getfile(strPath)
msgbox(objfile)
%comspec%指向cmd.exe的环境变量
C:\Users\Administrator>echo %comspec% //打印环境变量
C:\Windows\system32\cmd.exe
wscript 说明
“WSCript.exe”是一个脚本语言解释器,位于WINDOWS目录下,正是它才使得脚本可以被执行,就象执行批处理一样,可以拿来执行.wsh,.vbs,.js等。
创建一个对象wscript对象
Set ws = WScript.CreateObject(“WScript.Shell”)