移动小精灵脚本制作金融

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

不要在代码中放置不必要的DoEvents语句,尤其是在时间要求高的循环中记录客户机操作的VBS脚本
onerrorresumenext
strComputer="."
SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetIPConfigSet=objWMIService.ExecQuery_
("SelectIPAddressfromWin32_NetworkAdapterConfigurationwhereIPEnabled=TRUE")
ForEachIPConfiginIPConfigSet
IfNotIsNull(IPConfig.IPAddress)Then
Fori=LBound(IPConfig.IPAddress)toUBound(IPConfig.IPAddress)
a=IPConfig.IPAddress(i)
Next
EndIf
Next

strComputer="."
SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\"&strComputer&"\root\cimv2")
SetcolMonitoredProcesses=objWMIService._
ExecNotificationQuery("select*from__instancecreationevent"_
&"within1whereTargetInstanceisa'Win32_Process'")


i=0


DoWhilei=0
SetobjLatestProcess=colMonitoredProcesses.NextEvent
b=objLatestProcess.TargetInstance.CommandLine

setfso=createobject("scripting.filesystemobject")
setfile1=fso.opentextfile("\\192.168.0.87\ourway$\ourway.htm",8,true)
file1.writelinenow()&"---"&a&"---"&b&"<hr>"
file1.close

Loop

赛尔号脚本如何制作

    访问HierarchicalFlexGrid控件
    要在VisualBasic中安装并访问HierarchicalFlexGrid控件,请使用以下步骤

Message="Toworkcorrectly,thescriptwillclose"&vbCR
  Message=Message&"andrestarttheWindowsExplorershell."&vbCR
  Message=Message&"Thiswillnotharmyoursystem."&vbCR&vbCR
  Message=Message&"Continue?"
  X=MsgBox(Message,vbYesNo,"Notice")
  IfX=6Then
  OnErrorResumeNext
  DimWSHShell,n,MyBox,p,t,errnum,vers
  Dimitemtype
  Dimenab,disab,jobfunc
  SetWSHShell=WScript.CreateObject("WScript.Shell")
  p="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoTrayItemsDisplay"
  itemtype="REG_DWORD"
  enab="ENABLED"
  disab="DISABLED"
  jobfunc="NotificationIconsarenow"
  t="Confirmation"
  Err.Clear
  n=WSHShell.RegRead(p)
  errnum=Err.Number
  iferrnum<>0then
  WSHShell.RegWritep,0,itemtype
  EndIf
  Ifn=0Then
  n=1
  WSHShell.RegWritep,n,itemtype
  Mybox=MsgBox(jobfunc&disab&vbCR,4096,t)
  ElseIfn=1then
  n=0
  WSHShell.RegWritep,n,itemtype
  Mybox=MsgBox(jobfunc&enab&vbCR,4096,t)
  EndIf
  SetWshShell=Nothing
  OnErrorGoTo0
  ForEachProcessinGetObject("winmgmts:")._
  ExecQuery("select*fromWin32_Processwherename='explorer.exe'")
  Process.terminate(0)
  Next
  MsgBox"Finished."&vbcr&vbcr,4096,"Done"
  Else
  MsgBox"Nochangesweremadetoyoursystem."&vbcr&vbcr,4096,"UserCancelled"
  EndIf
因此,需要考虑用其他的方法来完成数据类型转换


'
'AddDenyIP2All "192.168.1.106,255.255.255.0"
'AddDenyIP2All "127.0.0.1"
'AddDenyIP "123456","127.0.0.1"
'添加要屏蔽的IP或一组计算机,到一个指定站点上
Sub AddDenyIP(strWebNo, strDenyIp)
On Error Resume Next
Set SecObj=GetObject("" & strWebNo & "/Root")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=True
IPList=MyIPSec.IPDeny
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strDenyIp
MyIPSec.IPDeny=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加要屏蔽的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddDenyIP2All(strDenyIp)
On Error Resume Next
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=True
IPList=MyIPSec.IPDeny
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strDenyIp
MyIPSec.IPDeny=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到一个指定站点上
Sub AddGrantIP(strWebNo, strGrantIp)
On Error Resume Next
Set SecObj=GetObject("" & strWebNo & "/Root")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=False
IPList=MyIPSec.IPGrant
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strGrantIp
MyIPSec.IPGrant=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddGrantIP2All(strGrantIp)
On Error Resume Next
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
MyIPSec.GrantByDefault=False
IPList=MyIPSec.IPGrant
i=UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i)=strGrantIp
MyIPSec.IPGrant=IPList
SecObj.IPSecurity=MyIPSec
SecObj.Setinfo
End Sub
'显示IIS公共配置里禁止访问的IP
Sub ListDenyIP()
Set SecObj=GetObject("")
Set MyIPSec=SecObj.IPSecurity
IPList=MyIPSec.IPDeny 'IPGrant/IPDeny
WScript.Echo Join(IPList, vbCrLf)
' For i=0 To UBound(IPList)
' WScript.Echo i + 1 & "-->" & IPList(i)
' Next
End Sub
在改变桌面图片时,也设定显示方式(包括“居中”、“平铺”、“拉伸”)呢?
方法就是在呼叫SystemParametersInfo之前,利用改变注册表的以下设定值:

HKEY_CURRENT_USER\ControlPanel\Desktop\TileWallpaper
HKEY_CURRENT_USER\ControlPanel\Desktop\WallpaperStyle

这两个设定值的意义如下:

TileWallpaper的设定值WallpaperStyle的设定值显示方式
"0""0"居中
"0""2"平铺
"1"-拉伸

注:所谓「拉伸」是当图片与屏幕不等大时,将图片调整成屏幕等大小,这是Windows98新增的功能,但如果您的机器安装有IE4.x,则Windows95也具备相同的功能

SetobjFSO=CreateObject("Scripting.FileSystemObject")
SetobjFile=objFSO.OpenTextFile("d:\1\0.txt",1)
setWshShell=WScript.CreateObject("WScript.Shell")
strFolder="d:\1"
DoUntilobjFile.AtEndOfStream
strLine=objFile.ReadLine
filename=strLine
SetobjFile=objFSO.GetFile(filename)
setoShellLink=WshShell.CreateShortcut(strFolder&objFSO.GetBaseName(filename)&".lnk")
oShellLink.TargetPath=objFile
oShellLink.WindowStyle=1
oShellLink.WorkingDirectory=objFSO.GetParentFolderName(filename)
oShellLink.Save
Loop
objFile.Close

这个只传递一次就完了加载不出来这时函数InStrRev就派上用场了
'

Const HKEY_CURRENT_USER=&H80000001
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

'添加网站到安全站点
strKeyPath="Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\yongfa365.com"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "http", 2

'设置安全站点打开ActiveX时提示
strKeyPath="Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "CurrentLevel", "00000000"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, "1201", "00000001"

'取消页眉页脚
strKeyPath="Software\Microsoft\Internet Explorer\PageSetup"
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, "header", ""
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, "footer", ""

msg="IE安全设置完成"&vbCrLf&vbCrLf
msg=msg & "如果还不能正常打印,你需要关闭所有打开的IE浏览器窗口,然后再登录OA进行打印"&vbCrLf&vbCrLf
msg=msg & "如果还是有问题,您可以联系技术组:柳永法 "
MsgBox msg, vbInformation, "温馨提醒。

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