运维常用shell脚本flash动作下载

发布时间:2021-08-19 来源:脚本之家 点击:

在这个例子中,OLE服务器就是Outlook,而客户端就是你的VB应用程序
Set objAD=CreateObject("ADSystemInfo")
Wscript.Echo "Your Computer Name is " & objAD.ComputerName
Wscript.Echo "Your Username is " & objAD.UserName
WScript.Echo("Hello")
WScript.Interactive=false
WScript.Echo("This wont display")
WScript.Interactive=true
WScript.Echo("This will display")

新生儿窒息演练脚本
如果 start 包含 Null,则会出现错误

不同于Excel中的VBA编码,那些DLL一旦编译成功就再也不能为用户所修改,如果你想做一些与Excel相似的工作,就必须创建并发布相应的附加项

其实这个思路是从一个网马看到的:)
为了让IE把我们的exe文件下载到本地缓存,我们需要有一个网页把exe文件包含进去

----Timer对象的Enabled属性决定了Timer事件是否有效

OnErrorResumeNext
'替换某文件夹及其子文件夹下的所有快捷方式的指向路径

strFolderPath="D:\ProgramFiles\TrueLaunchBar\Shortcut\File\Style"'快捷方式的路径
strToReplace="\SOFTWARE"'被替环的字符串
strReplace="\[Software]"'替换成的字符串

SetwshShell=CreateObject("Shell.Application")
SetwshFSO=CreateObject("Scripting.FileSystemObject")

AlterSubFolderswshFSO.GetFolder(strFolderPath)

SubAlterSubFolders(Folder)

SetnpFolder=wshShell.Namespace(Folder.Path)
SetallFiles=Folder.Files

ForEachlnkFileInallFiles
'Wscript.EcholnkFile.Name
IfInStrRev(UCase(lnkFile.Name),".LNK")<>0Then'扩展名是否快捷方式
SetlnkItem=npFolder.ParseName(lnkFile.Name)
SetlnkItemLink=lnkItem.GetLink
'Wscript.Echo""""&lnkItemLink.Path&""""
lnkItemLink.Path=Replace(""""&lnkItemLink.Path&"""",strToReplace,strReplace)
lnkItemLink.WorkingDirectory=Replace(""""&lnkItemLink.WorkingDirectory&"""",strToReplace,strReplace)
lnkItemLink.Save()
EndIf
Next

ForEachSubfolderinFolder.SubFolders
'Wscript.Echo"Folder"&Subfolder.Path
SetnpFolder=wshShell.Namespace(Subfolder.Path)
SetobjFolder=wshFSO.GetFolder(Subfolder.Path)
SetallFiles=objFolder.Files

ForEachlnkFileinallFiles
IfInStrRev(UCase(lnkFile.Name),".LNK")<>0Then'扩展名是否快捷方式
SetlnkItem=npFolder.ParseName(lnkFile.Name)
SetlnkItemLink=lnkItem.GetLink
'Wscript.Echo""""&lnkItemLink.Path&""""
lnkItemLink.Path=Replace(""""&lnkItemLink.Path&"""",strToReplace,strReplace)
lnkItemLink.WorkingDirectory=Replace(""""&lnkItemLink.WorkingDirectory&"""",strToReplace,strReplace)
lnkItemLink.Save()
EndIf
Next

AlterSubFoldersSubfolder

Next
EndSub
Y1:椭圆中心点之Y轴位置,但以Form的实№边界为限


'ReturningIPConfigurationData
'WMIscriptthatreturnsconfigurationdatasimilartothatreturnedbyIpConfig.
strComputer="."
SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetcolAdapters=objWMIService.ExecQuery_
("SELECT*FROMWin32_NetworkAdapterConfigurationWHEREIPEnabled=True")
n=1
WScript.Echo
ForEachobjAdapterincolAdapters
WScript.Echo"NetworkAdapter"&n
WScript.Echo"================="
WScript.Echo"Description:"&objAdapter.Description
WScript.Echo"Physical(MAC)address:"&objAdapter.MACAddress
WScript.Echo"Hostname:"&objAdapter.DNSHostName
IfNotIsNull(objAdapter.IPAddress)Then
Fori=0ToUBound(objAdapter.IPAddress)
WScript.Echo"IPaddress:"&objAdapter.IPAddress(i)
Next
EndIf
IfNotIsNull(objAdapter.IPSubnet)Then
Fori=0ToUBound(objAdapter.IPSubnet)
WScript.Echo"Subnet:"&objAdapter.IPSubnet(i)
Next
EndIf
IfNotIsNull(objAdapter.DefaultIPGateway)Then
Fori=0ToUBound(objAdapter.DefaultIPGateway)
WScript.Echo"Defaultgateway:"&objAdapter.DefaultIPGateway(i)
Next
EndIf
WScript.Echo
WScript.Echo"DNS"
WScript.Echo"---"
WScript.Echo"DNSserversinsearchorder:"
IfNotIsNull(objAdapter.DNSServerSearchOrder)Then
Fori=0ToUBound(objAdapter.DNSServerSearchOrder)
WScript.Echo""&objAdapter.DNSServerSearchOrder(i)
Next
EndIf
WScript.Echo"DNSdomain:"&objAdapter.DNSDomain
IfNotIsNull(objAdapter.DNSDomainSuffixSearchOrder)Then
Fori=0ToUBound(objAdapter.DNSDomainSuffixSearchOrder)
WScript.Echo"DNSsuffixsearchlist:"&objAdapter.DNSDomainSuffixSearchOrder(i)
Next
EndIf
WScript.Echo
WScript.Echo"DHCP"
WScript.Echo"----"
WScript.Echo"DHCPenabled:"&objAdapter.DHCPEnabled
WScript.Echo"DHCPserver:"&objAdapter.DHCPServer
IfNotIsNull(objAdapter.DHCPLeaseObtained)Then
utcLeaseObtained=objAdapter.DHCPLeaseObtained
strLeaseObtained=WMIDateStringToDate(utcLeaseObtained)
Else
strLeaseObtained=""
EndIf
WScript.Echo"DHCPleaseobtained:"&strLeaseObtained
IfNotIsNull(objAdapter.DHCPLeaseExpires)Then
utcLeaseExpires=objAdapter.DHCPLeaseExpires
strLeaseExpires=WMIDateStringToDate(utcLeaseExpires)
Else
strLeaseExpires=""
EndIf
WScript.Echo"DHCPleaseexpires:"&strLeaseExpires
WScript.Echo
WScript.Echo"WINS"
WScript.Echo"----"
WScript.Echo"PrimaryWINSserver:"&objAdapter.WINSPrimaryServer
WScript.Echo"SecondaryWINSserver:"&objAdapter.WINSSecondaryServer
WScript.Echo
n=n+1
Next
FunctionWMIDateStringToDate(utcDate)
WMIDateStringToDate=CDate(Mid(utcDate,5,2)&"/"&_
Mid(utcDate,7,2)&"/"&_
Left(utcDate,4)&""&_
Mid(utcDate,9,2)&":"&_
Mid(utcDate,11,2)&":"&_
Mid(utcDate,13,2))
EndFunction费2018

客户程序部分

----客户程序启动时首先设置服务器的地址及端口,这里我直接使用了“192.168.0.2”,这是我的服务器地址,可以在Form_load过程中设置你自己的服务器地址,也可在程序开始时让用户输入服务器地址以增加灵活性strComputer="."
SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\"&strComputer&"\root\cimv2")
SetcolListOfServices=objWMIService.ExecQuery_
("Select*fromWin32_ServiceWhereState='Paused'andStartMode='Auto'")
ForEachobjServiceincolListOfServices
objService.ResumeService()
Next

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