发布于 2009-08-21 08:44:27
0楼
贴段常用的VBS脚本:reset_WinCC.vbs ,还是学到不少东西。。。
'***************************************************
'Do not rearrange sequence of WinCC apps or services
'***************************************************
'*********************************
'Section for process termination
'*********************************
Set ProcessSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Process")
for each process in ProcessSet
proname = ucase(Left(process.Name,6))
Select Case proname
Case "APDIAG"
process.terminate
Case "AUTOST"
process.terminate
Case "BILDAN"
process.terminate
Case "CAREPO"
process.terminate
Case "CC_DPS"
process.terminate
Case "CC_MSH"
process.terminate
Case "CCACTI"
process.terminate
Case "CCALGI"
process.terminate
Case "CCALGR"
process.terminate
Case "CCARCH"
process.terminate
Case "CCAUTH"
process.terminate
Case "CCCLIE"
process.terminate
Case "CCCOMM"
process.terminate
Case "CCCONF"
process.terminate
Case "CCCSIG"
process.terminate
Case "CCDELT"
process.terminate
Case "CCDIAG"
process.terminate
Case "CCDMCL"
process.terminate
Case "CCDMIV"
process.terminate
Case "CCLBMR"
process.terminate
Case "CCLICE"
process.terminate
Case "CCMCPA"
process.terminate
Case "CCMETA"
process.terminate
Case "CCMIGR"
process.terminate
Case "CCNSIN"
process.terminate
Case "CCONLC"
process.terminate
Case "CCOPCC"
process.terminate
Case "CCPACK"
process.terminate
Case "CCPERF"
process.terminate
Case "CCPJOB"
process.terminate
Case "CCPROJ"
process.terminate
Case "CCPTMR"
process.terminate
Case "CCREDC"
process.terminate
Case "CCREDU"
process.terminate
Case "CCRTSL"
process.terminate
Case "CCRUNR"
process.terminate
Case "CCSCRI"
process.terminate
Case "CCSSMR"
process.terminate
Case "CCSTAR"
process.terminate
Case "CCSYNC"
process.terminate
Case "CCTEXT"
process.terminate
Case "CCTLGA"
process.terminate
Case "CCTLGS"
process.terminate
Case "CCTMCO"
process.terminate
Case "CCTMTI"
process.terminate
Case "CCTTRT"
process.terminate
Case "CCTXTP"
process.terminate
Case "CCUAED"
process.terminate
Case "CCUAIU"
process.terminate
Case "CCUASE"
process.terminate
Case "CCUSRA"
process.terminate
Case "CCWRIT"
process.terminate
Case "CCWINC"
process.terminate
Case "CHANNE"
process.terminate
Case "CSIGRT"
process.terminate
Case "DDESER"
process.terminate
Case "DIAGSE"
process.terminate
Case "DYNWIZ"
process.terminate
Case "EASYLA"
process.terminate
Case "GRAFEX"
process.terminate
Case "GSCCS."
process.terminate
Case "GSCRT."
process.terminate
Case "HMRT.E"
process.terminate
Case "HORNCS"
process.terminate
Case "LBMCS."
process.terminate
Case "MSCS.E"
process.terminate
Case "OPCTAG"
process.terminate
Case "PASSCS"
process.terminate
Case "PASSDB"
process.terminate
Case "PASSRE"
process.terminate
Case "PDLCSA"
process.terminate
Case "PDLRT."
process.terminate
Case "PDLSER"
process.terminate
Case "PRINT1"
process.terminate
Case "PRINTI"
process.terminate
Case "PROJEC"
process.terminate
Case "PROTCS"
process.terminate
Case "PRTSCR"
process.terminate
Case "PTMCS."
process.terminate
Case "RD1CS."
process.terminate
Case "REDUND"
process.terminate
Case "RPTRT."
process.terminate
Case "S7TGTO"
process.terminate
Case "S7HWCN"
process.terminate
Case "s cript"
process.terminate
Case "SDIAGR"
process.terminate
Case "SETUPD"
process.terminate
Case "SIGNSE"
process.terminate
Case "SIMULA"
process.terminate
Case "SOPCAE"
process.terminate
Case "SOPCHD"
process.terminate
Case "SOPCSR"
process.terminate
Case "SQLTOO"
process.terminate
Case "SSMSET"
process.terminate
Case "TAGANW"
process.terminate
Case "TEXTBI"
process.terminate
Case "TLGCS."
process.terminate
Case "TOUCHI"
process.terminate
Case "TRENDO"
process.terminate
Case "TTEDIT"
process.terminate
Case "VAR_EX"
process.terminate
Case "WINCCC"
process.terminate
Case "WINCCE"
process.terminate
Case "XREFC."
process.terminate
Case "XREFS."
process.terminate
Case "WEBNAV"
process.terminate
end select
next
'*********************************
'Section for service termination
'*********************************
'StopServices
Set ServiceSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Service")
for each service In ServiceSet
Select Case service.Name
Case "SCSMonitor" 'wincc service
service.stopservice
ws cript.sleep 3000
service.startservice
Case "CCEServer" 'WinCC service
service.stopservice
Case "CCEClient" 'WinCC service
service.stopservice
Case "CCAgent" 'WinCC service
service.stopservice
ws cript.sleep 3000
service.startservice
Case "RedundancyControl" 'WinCC service
service.stopservice
Case "RedundancyState" 'WinCC service
service.stopservice
end select
next
'*********************************
'Section for database detaching
'*********************************
'DetachAllWinCCDatabases
Dim lvoWshShell
Dim WinCCPath
Set lvoWshShell = CreateObject("Ws cript.Shell")
WinCCPath = lvoWshShell.RegRead("HKLM\Software\Siemens\AUTSW\WinCC\Path")
lvowshShell.run """" & WinCCPath & "\bin\DBDT.exe" & """" & " -DetachAll"
msgbox "ready"