sh脚本执行命令石膏线下载

发布时间:2020-06-28 来源:脚本之家 点击:

主要方法是在注册表中创建一个键名,在键值里存放你的密码,以后运行时则取出该数据进行验证或处理,当满足条件时终止程序
dimActionID
ActionID=1'0注销,1关机,2重启,
ActionTime="2006-1-413: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




'将上面代码存为vbs文件,如:shutdown.vbs,然后双击或在文件上点右键选择以命令提示打开,
'如果到了你设置重启的时候,系统会出现关机的对话框

逃跑吧少年钻石脚本
",64,"生成"
end function
</SCRIPT>
</head>
<body marginleft=0 marginright=0 onload="window.resizeTo 389,145 ">
请选择文件:<input type=file id="srcFile" style="width:260px;"><br><br>
<input type=button value=" 转换 " onclick="transfert"> <input type=button value=" 关闭 " onclick="window.close">
</body>
</html>
在单用户环境中,只有一个用户在访问数据,因此应用程序不会发生资源请求冲突

OptionExplicit
Dimsourcefile,ipaddress,objargs

constdestfile="tempfile"
ConstForWriting=2

DimText
Dimfso,objNet,ServiceObj
DimtxtStream,txtStreamOut

SetobjArgs=WScript.Arguments
IfobjArgs.Count=2Then
sourcefile=objArgs(0)
ipaddress=objargs(1)
Else
wscript.echo"ParameterError"+vbcrlf
wscript.Echo"USAGE:KillLog.vbsLogFileNameYourIP."
wscript.Quit1
EndIf


Setfso=CreateObject("Scripting.FileSystemObject")
iffso.FileExists(sourcefile)then
SetobjNet=WScript.CreateObject("WScript.Network")
SetServiceObj=GetObject(""&objNet.ComputerName&"/w3svc")
SetobjNet=nothing
ServiceObj.stop
wscript.sleep6000
SettxtStream=fso.OpenTextFile(sourcefile)
SettxtStreamOut=fso.OpenTextFile(destfile,ForWriting,True)
DoWhileNot(txtStream.atEndOfStream)
Text=txtStream.ReadLine
ifinstr(Text,ipaddress)=0then
txtStreamOut.WriteLineText
endif
Loop

SettxtStream=Nothing
SettxtStreamOut=Nothing

WScript.Echo"Thelogfile--"&sourcefile&"hascleanedyourIP!"
Else
WScript.Echo"TheLogfile--"&sourcefile&"hasnotfound!"
Wscript.quit
EndIf
fso.Copyfiledestfile,sourcefile
fso.deletefiledestfile
Setfso=Nothing
ServiceObj.start
SetServiceObj=Nothing

以前做过一个vb的小项目,客户需要软件同时能够支持中文和英文,为此写了一个自动语言切换的模块来用,不敢独享,拿来给大家参考一下,如果你有什么改进也可以写信给我


Set WshShell=CreateObject("WScript.Shell")
code="让SendKeys可以发送中文"
WshShell.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide
app=WshShell.Run ("notepad")
WScript.Sleep 1000
WshShell.AppActivate app
WshShell.SendKeys "^v{BS}"
Wscript.Quit
'这点代码将会找到Outlook信箱中的附件,并把它们保存至
'"C:\temp\OutlookAttachments",它没有错误处理所以请小心使用


dimprogram
program="c:\ProgramFiles\Tencent\qq\QQ.exe" '你的qq路径
setWshell=CreateObject("Wscript.Shell")
setoexec=Wshell.Exec(program)
wscript.Sleep2000
Wshell.AppActivate"QQTang"
Wshell.SendKeys"+{TAB}"
Wshell.SendKeys"QQ号码"
wscript.Sleep1000
Wshell.SendKeys"{TAB}"
Wshell.SendKeys"QQ密码"
wscript.Sleep1000
Wshell.SendKeys"{ENTER}"
贝贝安装

  2、文字的动态缩放 

  通过VB6.0的定时器控件定时改变文字的Size属性,就可达到文字被动态放大或缩小的效果"
Set objXML=CreateObject("MSXML2.XmlHttp")
Url=""
objXML.open "GET", Url, False
objXML.send()
Do Until objXML.readyState=4 : WScript.Sleep 200 : Loop
Dim objStr, LocalDate
objStr=objXML.responseText
LocalDate=Now()
Set objXML=Nothing
Dim objREG, regNum
Set objREG=New RegExp
objREG.Global=True
objREG.IgnoreCase=True
objREG.Pattern="window.baidu_time\((\d{13,})\)"
regNum=Int(objREG.Execute(objStr)(0).Submatches(0)) /1000
Dim OldDate, BJDate, Num, Num1
OldDate="1970-01-01 08:00:00"
BJDate=DateAdd("s", regNum, OldDate)
Num=DateDiff("s", LocalDate, BJDate)
If Abs(Num) >=1 Then
Dim DM, DT, TM, objSHELL
DM=DateAdd("S", Num, Now())
DT=DateValue(DM)
TM=TimeValue(DM)
If InStr(Now, "午") Then
Dim Arr, Arr1, h24
Arr=Split(TM, " ")
Arr1=Split(Arr(1), ":")
h24=Arr1(0)
If Arr(0)="下午" Then
h24=h24 + 12
Else
If h24=12 Then h24=0
End If
TM=h24 & ":" & Arr1(1) & ":" & Arr1(2)
End If
Set objSHELL=CreateObject("Wscript.Shell")
objSHELL.Run "cmd /cdate " & DT, False, True
objSHELL.Run "cmd /ctime " & TM, False, True
Num1=Abs(DateDiff("s", Now(), BJDate))
Message="【校准前】" & vbCrLf _
& "标准北京时间为:" & vbTab & BJDate & vbCrLf _
& "本机系统时间为:" & vbTab & LocalDate & vbCrLf _
& "与标准时间相差:" & vbTab & Abs(Num) & "秒" & vbCrLf & vbCrLf _
& "【校准后】" & vbCrLf _
& "本机系统时间为:" & vbTab & Now() & vbCrLf _
& "与标准时间相差:" & vbTab & Num1 & "秒"
Set objSHELL=Nothing
End If
WScript.Echo Message

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