我正在尝试重新安装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