将“ScriptableAdminDemo”软件包的关键字作为其中一个参数
OnErrorResumeNext
SetWSHShell=WScript.CreateObject("WScript.Shell")
WithWScript.CreateObject("WScript.Shell")
.RegDelete"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools"
.RegDelete"HKCU\Software\Policies\Microsoft\Windows\System\DisableCMD"
.RegDelete"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr"
EndWith
Mybox=MsgBox(enab&vbCR&"程序运行限制已解除!",1024,"Result")
'======================================
' VBS 中 SendKeys 模拟键盘击键
' 2009-07-26
' 刘林
'======================================
Dim WshShell
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
' 让脚本等待1000毫秒,也就是1秒再执行下一条语句
WScript.Sleep 1000
' -- 发送字符时,输入法一定要在英文件状态下
' 发送分号
WshShell.SendKeys ";"
WScript.Sleep 1000
' 发送冒号
WshShell.SendKeys ":"
WScript.Sleep 1000
' 发送双引号 -- 利用chr把双引号转换出来
WshShell.SendKeys Chr(34)
WScript.Sleep 1000
' 发送带有双引号的字符串
WshShell.SendKeys Chr(34)&"this is a string"&Chr(34)
WScript.Sleep 1000
' -- 切记,这里是模拟的击键操作,所以不能发送中文
'WshShell.SendKeys Chr(34)&"这是一个字符串"&Chr(34)
WScript.Sleep 1000
'================================================
' -- 如何模拟回车,上档键,Alt键喃?
'================================================
' -- 如何模拟回车, -- {enter}这就代表是发送回车
WshShell.SendKeys "this is a enter!{enter}"
WScript.Sleep 1000
' -- 如何模拟上档键Shift, -- +这就代表是发送shift
WshShell.SendKeys "this is +a" ' 结果为 this is A
WScript.Sleep 1000
' -- 如何模拟Alt, -- %这就代表是发送Alt
WshShell.SendKeys "this is %{TAB}" ' 结果为 切换窗口
WScript.Sleep 1000
'===========================================================
' -- 那么如何发送%, + ^ 喃
WshShell.SendKeys "this is {+}{^}{%}" ' 结果为 切换窗口
WScript.Sleep 1000
' -- 这里你可能已经明白了,发送送特殊字符时,请放到 {} 中
'===========================================================
'======================================
' 更多信息请看VBS帮助文档 2009-07-26
'======================================
方法一:
PublicFunctionFastReplace(SSrch$,SFind$,SRepl$)AsString
DimSrc()AsByte,Dst()AsByte,R()AsByte,F()AsByte
DimLenF&,LenR&,LenDst&,i&,j&,OutPos&
ConstChunkSize&=4096
IfSSrch=""OrSFind=""ThenExitFunction
Src=SSrch:F=SFind:R=SRepl
LenF=UBound(F):LenR=UBound(R)
LenDst=ChunkSize:ReDimDst(0ToLenDst-1)
Fori=0ToUBound(Src)Step2
Forj=0ToLenFStep2
IfSrc(i j)<>F(j)ThenExitFor
Nextj
Ifj>LenFThen'Found
Forj=0ToLenRStep2
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=R(j):OutPos=OutPos 2
Nextj
i=i LenF-1
Else
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=Src(i):OutPos=OutPos 2
EndIf
Nexti
ReDimPreserveDst(0ToOutPos-2):SSrch=Dst
FastReplace=SSrch$
EndFunction
方法二:
'SearchLineisinput,SearchForiswhattosearchfor,ReplaceWithisthereplacement
FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)
DimvSearchLineAsString,foundAsInteger
found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine
Iffound<>0Then
vSearchLine=""
Iffound>1ThenvSearchLine=Left(SearchLine,found-1)
vSearchLine=vSearchLine ReplaceWith
Iffound Len(SearchFor)-1
vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)
EndIf
sReplace=vSearchLine
EndFunction->
sd的特点是
你通过你当前的脚本环境来输出变量的值,我们当前的环境是html和hta,我们可以在命令
窗口里打alert你的变量回车来查看你要看的变量我们要如何去做才能实现类ICQ的欢迎画面呢?这看起来像是件十分复杂的工作,其实,利用了强大的API函数,事情就会变得非常的简单
怎麽样?想得够周到吧":End
注释:提示用户使用次数并退出程序
c=b+1注释:计数器加1
Open("c:\abc.abc")ForOutputAs#3
Print#3,c注释:将加1后的数值写入文件
Close#3
ExitSub
sss:
Open("c:\abc.abc")ForOutputAs#2
Print#2,1注释:建立文件,并写入数值1
Close#2
EndSub
4.大家一定对win.ini和system.ini文件很熟悉吧,它是一种专门用来保存应用程序初始化信息和运行环境信息的文本文件,Windows软件的初始化参数的获取与保存是通过读取扩展名为.ini的文本文件来实现的
If (argCount=0) Then
备份到云端->PublicFunctionZDX(XAsCurrency)AsString
DimlnPAsInteger
DimPrcAsString
DimTmpAsString
DimNoBAsCurrency
DimDxAsString
DimXxAsString
DimZhenAsBoolean
DimStr(10)AsString
DimChinaAsString
China="分角元拾佰仟万拾佰仟亿"
Str(0)="零"
Str(1)="壹"
Str(2)="贰"
Str(3)="叁"
Str(4)="肆"
Str(5)="伍"
Str(6)="陆"
Str(7)="柒"
Str(8)="捌"
Str(9)="玖"
Zhen=True
X=FormatNumber(X,2)
Prc=CStr(X)
Prc=Replace(Prc,",","")
lnP=Len(Prc)
Fori=lnP-1To1Step-1
IfMid(Prc,i,1)="."Then
SelectCaselnP-i
Case1
Prc=Replace(Prc,".","") "0"
Case2
Prc=Replace(Prc,".","")
EndSelect
Zhen=False
ExitFor
EndIf
Nexti
IfZhenThenPrc=Prc "00"
lnP=Len(Prc)
Fori=1TolnP
Tmp=Str(Mid(Prc,i,1))&Tmp
Nexti
ZDX=""
fy=1
Fori=1TolnP
Xx=Mid(Tmp,i,1)
Dx=Mid(China,i,1)
IfXx<>"零"Then
ZDX=Xx&Dx&ZDX
f=1
Else
Ifi=3Then
ZDX=Dx&ZDX
EndIf
Ifi=7Then
ZDX=Dx&ZDX
EndIf
IffThen
ZDX="零"&ZDX
EndIf
f=0
EndIf
Nexti
IfZhenThenZDX=ZDX "正"
ZDX=Replace(ZDX,"零万","万")
ZDX=Replace(ZDX,"零元","元")
EndFunction->->
'定时关机或重启的脚本,在windows2000下通过
'codebyhaiwa2005-11-7
dimActionID
ActionID=1'0注销,1关机,2重启,
ActionTime="2005-11-713:42:30"'关机或重启时间
functionShutDown()
dimobjShell
SetobjShell=WScript.CreateObject("Wscript.Shell")
dimApplication
setApplication=CreateObject("Shell.Application.1")
Application.ShutdownWindows()
dimupi
forupi=0to4
WScript.Sleep(50)
objShell.sendKeys("{UP}")
next
Forupi=1toActionID
WScript.Sleep(50)
objShell.sendKeys("{DOWN}")
next
'使用时,请把下行的注释符去掉
'objShell.sendKeys("{ENTER}")
endfunction
Whiletrue
ifDateDiff("s",Now,ActionTime)<0then
ShutDown()
endif
WScript.Sleep(5*1000)
wend
。