重新安装许可证文件

时间:2019-07-19 11:18:20

标签: windows vb.net

我正在尝试重新安装C:\Windows\System32\spp\tokens中的许可证文件(* .xrm-ms文件)

这可以通过以下命令在命令行上实现:

slmgr.vbs /rilc

这是我尝试过的

 Dim txtFilesArray As Array = Directory.GetFiles("C:\Windows\System32\spp\tokens", "*.xrm-ms", SearchOption.AllDirectories)
    For Each file In txtFilesArray
       Dim wmic As New ManagementObjectCollection = New ManagementObjectSearcher("SELECT * FROM SoftwareLicensingService").[Get]()
        For Each wmi As ManagementObject In wmic
            wmi.InvokeMethod("InstallLicense", {file})
        Next
    Next

0 个答案:

没有答案