使用 vbscript 删除 GAC 程序集

发布于 2024-07-08 12:07:35 字数 40 浏览 7 评论 0原文

如标题所示,如何使用 vbscript 删除 GAC 程序集文件?

Like the title says, how can I remove GAC assembly file using vbscript?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

掩饰不了的爱 2024-07-15 12:07:35

您可以运行此命令将其从 GAC 中卸载:

gacutil /u YourAssembly

You can run this to uninstall it from GAC:

gacutil /u YourAssembly
落日海湾 2024-07-15 12:07:35

我记得 gacutil 在启用 .NET 的 shell 中。

C:\>gacutil
Microsoft (R) .NET Global Assembly Cache Utility.  Version 3.5.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

Usage: Gacutil <command> [ <options> ]
Commands:
  /i <assembly_path> [ /r <...> ] [ /f ]
    Installs an assembly to the global assembly cache.

  /il <assembly_path_list_file> [ /r <...> ] [ /f ]
    Installs one or more assemblies to the global assembly cache.

  /u <assembly_display_name> [ /r <...> ]
    Uninstalls an assembly from the global assembly cache.

  /ul <assembly_display_name_list_file> [ /r <...> ]
    Uninstalls one or more assemblies from the global assembly cache.

  /l [ <assembly_name> ]
    List the global assembly cache filtered by <assembly_name>

  /lr [ <assembly_name> ]
    List the global assembly cache with all traced references.

  /cdl
    Deletes the contents of the download cache

  /ldl
    Lists the contents of the download cache

  /?
    Displays a detailed help screen

 Options:
  /r <reference_scheme> <reference_id> <description>
    Specifies a traced reference to install (/i, /il) or uninstall (/u, /ul).

  /f
    Forces reinstall of an assembly.

  /nologo
    Suppresses display of the logo banner

  /silent
    Suppresses display of all output

As I remember gacutil in a .NET enabled shell.

C:\>gacutil
Microsoft (R) .NET Global Assembly Cache Utility.  Version 3.5.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

Usage: Gacutil <command> [ <options> ]
Commands:
  /i <assembly_path> [ /r <...> ] [ /f ]
    Installs an assembly to the global assembly cache.

  /il <assembly_path_list_file> [ /r <...> ] [ /f ]
    Installs one or more assemblies to the global assembly cache.

  /u <assembly_display_name> [ /r <...> ]
    Uninstalls an assembly from the global assembly cache.

  /ul <assembly_display_name_list_file> [ /r <...> ]
    Uninstalls one or more assemblies from the global assembly cache.

  /l [ <assembly_name> ]
    List the global assembly cache filtered by <assembly_name>

  /lr [ <assembly_name> ]
    List the global assembly cache with all traced references.

  /cdl
    Deletes the contents of the download cache

  /ldl
    Lists the contents of the download cache

  /?
    Displays a detailed help screen

 Options:
  /r <reference_scheme> <reference_id> <description>
    Specifies a traced reference to install (/i, /il) or uninstall (/u, /ul).

  /f
    Forces reinstall of an assembly.

  /nologo
    Suppresses display of the logo banner

  /silent
    Suppresses display of all output
柏林苍穹下 2024-07-15 12:07:35

您可以将 WSH 与 VBScript 结合使用,并使用 WSH 打开文件。

http://www.mhuffman.com/notes/language/vbs_intro.htm

You can use WSH with VBScript, and open the file using WSH.

http://www.mhuffman.com/notes/language/vbs_intro.htm

笑饮青盏花 2024-07-15 12:07:35

以下是从 VBScript 调用 gacutil 工具的方法:

Const GACUTILPATH = "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe"
strAssembly = "MyAssembly"  '' or "MyAssembly,Version=1.1.0.0,Culture=en,PublicKeyToken=874e23ab874e23ab"

Set oShell  = CreateObject("WScript.Shell")
oShell.Run """" & GACUTILPATH & """ /nologo /u " & strAssembly

Here's how you can call the gacutil tool from VBScript:

Const GACUTILPATH = "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe"
strAssembly = "MyAssembly"  '' or "MyAssembly,Version=1.1.0.0,Culture=en,PublicKeyToken=874e23ab874e23ab"

Set oShell  = CreateObject("WScript.Shell")
oShell.Run """" & GACUTILPATH & """ /nologo /u " & strAssembly
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文