在这个vbscript中,第二个Err.Clear是否作为优化的一部分是必需的。
Set WshShell = CreateObject("WScript.Shell") strSpoRootKey = "HKLM\SOFTWARE\" strKey = RootKey & "tcc\Operation\" & Version & "\Location" strPath = wshShell.RegRead(strKey) If Err Then Err.Clear //first Err.clear RootKey = "HKLM\SOFTWARE\Wow6432Node" strKey = RootKey & "tcc\Operation\" & Version & "\Location" strPath = wshShell.RegRead(strKey) If Err Then Err.Clear // second Err.clear