孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Sub Register(strFilePath,regMethod)

    Dim theFile,strFile,oShell ,exitcode

    Set  theFile=oFs.GetFile(strFilePath)

    strFile=theFile.Path

    Set oShell=CreateObject("WScript.Shell")

    If regMethod="REG" then

      oShell.Run "C:\winnt\system32\regsvr32.exe /s" & strFile,0,False

      exitcode=oShell.Run("C:\.........";0,False)

      EchoB("regsvr32.exe exitcode=" & exitcode)

    Else

       oShell.Run "C:\winnt\system32\regsvr32.exe /u/s" & strFile,0,False

       exitcode=oShell.Run("C:\........";0,False)

       EchoB("regsvr32.exe exitcode=" & exitcode)

    End If 

    Clearup oShell

End Sub

posted on 2008-09-21 08:59  孤独的猫  阅读(171)  评论(0编辑  收藏  举报