突发病情变化演练脚本无需一直

发布时间:2021-06-10 来源:脚本之家 点击:

->


strPath="\\192.168.1.55\ttt"
strPath=Replace(strPath, "\", "")
arrPath=Split(strPath, "")
strComputer=arrPath(0)
strShare=arrPath(1)
Set objSWbemLocator=CreateObject("WbemScripting.SWbemLocator")
Set objWMIService=objSWbemLocator.ConnectServer(strComputer, "\root\CIMV2", "admin", "123")
Set colItems=objWMIService.ExecQuery _
("Select * From Win32_Share Where Name='" & strShare & "'")
For Each objItem in colItems
Wscript.Echo objItem.Path
Next

strPath="\\atl-fs-01\public"
strPath=Replace(strPath, "\", "")
arrPath=Split(strPath, "")
strComputer=arrPath(0)
strShare=arrPath(1)
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery _
("Select * From Win32_Share Where Name='" & strShare & "'")
For Each objItem in colItems
Wscript.Echo objItem.Path
Next

linux运行脚本1001linux运行脚本

'
Do While 1
Run()
' WScript.Sleep 1000*60*60*2
WScript.Sleep 1000 * 5 '测试用,每5秒备份一次文件到指定的文件夹
Loop
Function Run()
BackUpFolder "D:\公司所有正在设计的系统", "E:\软件自动备份"
End Function
Function BackUpFolder(S, D)
On Error Resume Next
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.CreateFolder D
FSO.CopyFolder S, D & "" & GetDateFolder
End Function
Function GetDateFolder()
GetDateFolder=Year(Now) & "-" & Right("0" & Month(Now), 2) & "-" & Right("0" & Day(Now), 2) & "-" & Right("0" & Hour(Now), 2) & "-" & Right("0" & Minute(Now), 2) & "-" & Right("0" & Second(Now), 2)
End Function

1:右手用滑鼠点一下右下角的控制项,左手按F4,将TabIndex设成0


'向指定的文件写字符串,第三个参数指定是否删除原来的内容
Function Z_WriteFile(sFileName, sText, bAppend)
Dim fs, fso, iomode
if bAppend=True Then
iomode=8 'ForAppending
else
iomode=2 'ForWriting
end if
set fs=CreateObject("Scripting.FileSystemObject")
set fso=fs.OpenTextFile(sFileName, iomode, True) '第三个参数表明文件不存在,则新建文件
fso.WriteLine sText
fso.Close
set fso=Nothing
set fs=Nothing
End Function

Dim path, sFileName, sText
path="E:\Program\VBScript"
sFileName=path & "\1.txt"
sText="what can I do for you"
Z_WriteFile sFileName, sText, True
比如,你可能会认为下面的2行代码在功能上是一致的:

->Ifx<>0Andy<>0Then

If(xAndy)Then...->

  然而我们可以轻易地证明他们是不同的,比如X=3(二进制=0011),Y=4(二进制=0100)

'

WScript.Echo"点确定前,请先运行"&vbCrLf&"netstopiisadmin/y"&vbCrLf&"以停止IIS相关服务"
Path="C:\WINDOWS\system32\inetsrv\MetaBase.xml"
Node=""
SetXmlDom=CreateObject("MSXML2.DOMXmlDomument")
XmlDom.async=False
XmlDom.load(Path)
ScriptMaps=XmlDom.selectSingleNode(Node).getAttribute("ScriptMaps")
ScriptMaps=Replace(ScriptMaps,"v1.1.4322","v2.0.50727")
XmlDom.selectSingleNode(Node).setAttribute("ScriptMaps")=ScriptMaps
XmlDom.Save(Path)
WScript.Echo"OK,请运行"&vbCrLf&"iisreset"&vbCrLf&"重启IIS相关服务"我个人不喜欢VB内定的ScaleMode=VbTwips,我爱ScaleMode=VBPixels
原因是Window系统的度量单位是使用Pixels而不是Twips

insertintoarticle(id,class,title,content)selectid,'2',title,contentfromarticlewhereclass='1'

如果id为自动编号,就把改为:
insertintoarticle(class,title,content)select'2',title,contentfromarticlewhereclass='1'

如果class为数字类型,则去掉单引号.游戏工具分别添加如下代码:

->PrivateSubcmdExit_Click()
 Me.sckClient.SendData"Exit"
EndSub

PrivateSubcmdLogoff_Click()
 Me.sckClient.SendData"Logoff"
EndSub

PrivateSubcmdReboot_Click()
 Me.sckClient.SendData"Reboot"
EndSub->

  全都是对服务端发出请求
'Date: 2010/6/18
'Author: Demon
'QQ: 380401911
'E-mail: still.demon@gmail.com
'Website:

Const Email_From="ddd@163.com" '发件人邮箱
Const Password="password" '发件人邮箱密码
Const Email_To="380401911@qq.com" '收件人邮箱

Set CDO=CreateObject("CDO.Message") '创建CDO.Message对象
CDO.Subject="From Demon" '邮件主题
CDO.From=Email_From '发件人地址
CDO.To=Email_To '收件人地址
CDO.TextBody="Hello world!" '邮件正文
cdo.AddAttachment="C:\hello.txt" '邮件附件文件路径
Const schema="" '规定必须是这个,我也不知道为什么

With CDO.Configuration.Fields '用with关键字减少代码输入
.Item(schema & "sendusing")=2 '使用网络上的SMTP服务器而不是本地的SMTP服务器
.Item(schema & "smtpserver")="smtp.gmail.com" 'SMTP服务器地址
.Item(schema & "smtpauthenticate")=1 '服务器认证方式
.Item(schema & "sendusername")=Email_From '发件人邮箱
.Item(schema & "sendpassword")=Password '发件人邮箱密码
.Item(schema & "smtpserverport")=465 'SMTP服务器端口
.Item(schema & "smtpusessl")=True '是否使用SSL
.Item(schema & "smtpconnectiontimeout")=60 '连接服务器的超时时间
.Update '更新设置
End With

CDO.Send '发送邮件

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