ASP中对注册表的操作

来源:互联网 发布:visa有什么用 知乎 编辑:程序博客网 时间:2024/04/29 18:39

Sub RegisterCrystalRuntimeSupportFile2
    dim wsh,IsReg,RunStatus
    set wsh=CreateObject("WScript.Shell")
    on error resume next
    IsReg=wsh.RegRead("HKLM/Software/ZXSOFT/MPS/IsRegister")
    if IsEmpty(IsReg) then
        RunStatus=wsh.Run(Server.MapPath("bin") & "/Register.bat",0,true)
        if RunStatus=0 then
            wsh.Regwrite "HKLM/Software/ZXSOFT/MPS/IsRegister","True","REG_SZ"
        else
            'Error
        end if
     else if lcase(IsReg)<>"true" then
        RunStatus=wsh.Run(Server.MapPath("bin") & "/Register.bat",0,true)
        if RunStatus=0 then
             wsh.Regwrite "HKLM/Software/ZXSOFT/MPS/IsRegister","True","REG_SZ"
        else
             'Error
        end if
     end if
End Sub

原创粉丝点击