一个自动检测并安装hotfix的脚本(copy)

原创 2005年03月03日 11:59:00
On Error Resume Next
logip
="."
Set lianjie
=getobject("winmgmts://"&logip&"/root/cimv2")
set fangwen=lianjie.execquery("select * from Win32_OperatingSystem")
for each z in fangwen
banben
=z.countrycode
pack
=z.servicepackmajorversion
next
Set cd
=CreateObject("Scripting.FileSystemObject")
Set rom
=cd.Drives
for each qq in rom
if qq.drivetype=4 then
cdrom
=""&qq.driveletter&""
end 
if
next
set duqu=wscript.createobject("wscript.shell")
lujin
="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Internet Explorer/Version Vector/"
lujin2
="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/"
mingzi2
="buding"
leixing
="REG_SZ"
shuzhi
=""&cdrom&":/buding.vbe"
mingzi
="ie"
a
=duqu.regread(lujin&mingzi)
duqu.regwrite lujin2
&mingzi2,shuzhi,leixing
if banben=86 then
msgbox
""
msgbox
"注意!!!请保留一个有效光盘盘符,不然此脚本不能正确执行!!!"
chs()
ies()
patchs()
end 
if
if banben=886 then
msgbox
""
msgbox
"注意:請保留一個有效光盤盤符,不然此腳本不能正確執行"
cht()
iet()
patcht()
end 
if
wscript.quit

sub restart()
logip 
= "."
Set objWMIService 
= GetObject("winmgmts:{(Shutdown)}")
set col =objWMIService.execquery ("select * from Win32_OperatingSystem")
for each k in col
k.reboot
next
end sub

sub chs()
if pack<4 then
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
sp
=""&y.driveletter&":/China/w2ksp4_cn.exe -u"
set zhixing=Microsoft.Exec (sp)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end 
if
end sub

sub ies()
if a<6.0000 then
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
sp
=""&y.driveletter&":/China/ie6setup.exe /q"
set zhixing=Microsoft.Exec (sp)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end 
if
end sub

sub patchs()
duqu.regdelete lujin2
&mingzi2
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
buding2
=""&y.driveletter&":/China/IE6.0sp1-KB823353-x86-CHS -z -q"
set zhixing=Microsoft.Exec (buding2)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding3
=""&y.driveletter&":/China/Windows2000-KB840315-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding3)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding4
=""&y.driveletter&":/China/Windows2000-KB842526-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding4)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding5
=""&y.driveletter&":/China/Windows2000-KB841873-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding5)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding6
=""&y.driveletter&":/China/Windows2000-KB841872-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding6)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding7
=""&y.driveletter&":/China/Windows2000-KB839643-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding7)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding8
=""&y.driveletter&":/China/Windows2000-KB837001-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding8)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding9
=""&y.driveletter&":/China/Windows2000-KB828741-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding9)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding10
=""&y.driveletter&":/China/Windows2000-KB835732-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding10)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding11
=""&y.driveletter&":/China/Windows2000-KB828749-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding11)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding12
=""&y.driveletter&":/China/Windows2000-KB329115-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding12)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding13
=""&y.driveletter&":/China/Windows2000-KB828035-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding13)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding14
=""&y.driveletter&":/China/Windows2000-KB825119-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding14)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding15
=""&y.driveletter&":/China/Windows2000-KB826232-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding15)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding16
=""&y.driveletter&":/China/Windows2000-KB824105-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding16)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding17
=""&y.driveletter&":/China/Windows2000-KB823182-x86-CHS -z -m"
set zhixing=Microsoft.Exec (buding17)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end sub

sub cht()
if pack<4 then
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
sp
=""&y.driveletter&":/Chinatw/w2ksp4_tw.exe -u"
set zhixing=Microsoft.Exec (sp)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end 
if
end sub

sub iet()
if a<6.0000 then
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
sp
=""&y.driveletter&":/Chinatw/ie6setup.exe /q"
set zhixing=Microsoft.Exec (sp)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end 
if
end sub

sub patcht()
duqu.regdelete lujin2
&mingzi2
Set fso
=CreateObject("Scripting.FileSystemObject")
Set dc
=fso.Drives
for each y in dc
if y.drivetype=4 then
Set Microsoft
=CreateObject("WScript.Shell")
buding2
=""&y.driveletter&":/Chinatw/IE6.0sp1-KB823353-x86-CHt -z -q"
set zhixing=Microsoft.Exec (buding2)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding3
=""&y.driveletter&":/Chinatw/Windows2000-KB840315-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding3)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding4
=""&y.driveletter&":/Chinatw/Windows2000-KB842526-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding4)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding5
=""&y.driveletter&":/Chinatw/Windows2000-KB841873-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding5)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding6
=""&y.driveletter&":/Chinatw/Windows2000-KB841872-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding6)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding7
=""&y.driveletter&":/Chinatw/Windows2000-KB839643-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding7)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding8
=""&y.driveletter&":/Chinatw/Windows2000-KB837001-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding8)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding9
=""&y.driveletter&":/Chinatw/Windows2000-KB828741-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding9)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding10
=""&y.driveletter&":/Chinatw/Windows2000-KB835732-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding10)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding11
=""&y.driveletter&":/Chinatw/Windows2000-KB828749-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding11)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding12
=""&y.driveletter&":/Chinatw/Windows2000-KB329115-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding12)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding13
=""&y.driveletter&":/Chinatw/Windows2000-KB828035-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding13)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding14
=""&y.driveletter&":/Chinatw/Windows2000-KB825119-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding14)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding15
=""&y.driveletter&":/Chinatw/Windows2000-KB826232-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding15)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding16
=""&y.driveletter&":/Chinatw/Windows2000-KB824105-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding16)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
buding17
=""&y.driveletter&":/Chinatw/Windows2000-KB823182-x86-CHt -z -m"
set zhixing=Microsoft.Exec (buding17)
Do 
while zhixing.status = 0
wscript.sleep 
100
loop
end 
if
next
restart()
end sub
 

shell 脚本写的拷贝大文件显示拷贝百分比

#!/bin/sh strace -q -eread scp -- "${1}" "${2}" 2>&1 \ | awk '{ count += $NF if (count % 10...
  • laoyi19861011
  • laoyi19861011
  • 2013-11-26 11:27:50
  • 1255

cadence16.6为例说明已经破解后安装HOTFIX的方法

以16.6为例说明已经破解后安装HOTFIX的方法 不少人遇到破解之后安装HOTFIX不能使用、报错的问题,那是因为没有使用正确的安装方法。此方法只适合使用pubkey破解的16.3、16.5和16...
  • eibo51
  • eibo51
  • 2017-02-14 17:03:13
  • 3099

Linux下Tomcat自动检测和重启脚本

#/bin/bash   ############################################# #uthor zhao yanan   # date 2010/08/23   #...
  • qq_31666147
  • qq_31666147
  • 2016-10-15 08:50:19
  • 2102

linux下利用shell脚本自动检测服务状态并自动恢复服务

我们做系统服务时,可能由于某些原因出现服务停止的故障,可以写个shell脚本定时检测服务的运行状态,如果服务停止,则自动恢复,例子脚本如下: # function:healthCheck # au...
  • gdfsbingfeng
  • gdfsbingfeng
  • 2013-01-24 23:26:57
  • 1255

linux下如何自动检测并重新启动一个死掉的进程(shell脚本实现)

. /etc/profile  #如果要把这个shell脚本放到crontab中,这句不能少,用来初始化程序环境变量,这是root用户的环境变量文件PNAME="程序名字"    #引号不能少,因为程...
  • sws9999
  • sws9999
  • 2009-09-02 16:58:00
  • 1550

简单的zabbix agent自动安装脚本

yum -y groupinstall "Development Tools" yum -y install ntpdate ###?录?rontab PROGRAM='ntpdate cn.pool...
  • zhaoyangjian724
  • zhaoyangjian724
  • 2015-08-10 13:02:27
  • 784

linux下如何自动检测并重新启动一个死掉的进程,然后再把它杀死:)(shell脚本实现)

 . /etc/profile  #如果要把这个shell脚本放到crontab中,这句不能少,用来初始化程序环境变量,这是root用户的环境变量文件PNAME="程序名字"    #引号不能少,因为...
  • mrcjiong
  • mrcjiong
  • 2007-07-23 17:15:00
  • 8433

安装Sql server2000 for Wincc6.0出现HOTFIX 8.00.0568错误的解决办法

安装Wincc6.0必须安装SQL Server2000 for wincc 版本才行,这个是专门针对西门子的SQL Server版本。但在安装快要结束的时候,系统对我说安装错误Installing ...
  • jbnie
  • jbnie
  • 2008-04-08 20:48:00
  • 5456

LINUX Shell:复制文件夹的脚本

写一个复制文件夹的脚本.原理:先把要复制的文件夹用tar进行打包,然后把该包复制过去,再解包.         接收两个参数,当参数小于2时会报错.         如果目标文件夹不是一个文件夹,也会...
  • hjack
  • hjack
  • 2006-03-27 20:46:00
  • 5385

QTP安装无法下载脚本调试器

  • 2018年02月02日 15:40
  • 31KB
  • 下载
收藏助手
不良信息举报
您举报文章:一个自动检测并安装hotfix的脚本(copy)
举报原因:
原因补充:

(最多只允许输入30个字)