我正在铁蓬撰写一个小型水电方案,以安装使用WMI的遥控机器。
现在,只要在目标机器(Machine_B)的当地驱动力上有 m子,该笔文字就安装了机器-A的机器。 我希望能够用正文把档案放在人质(Machine_A)机器上。
network_scope = r"\%Machine_B
ootcimv2"
scope = ManagementScope(network_scope, options)
scope.Connect()
mp = ManagementPath("Win32_Product")
ogo = ObjectGetOptions()
mc = ManagementClass(scope, mp, ogo)
inParams = mc.GetMethodParameters ("Install")
inParams["PackageLocation"] = r"C:installspython-3.1.1.msi"
inParams["AllUsers"] = True
retVal = mc.InvokeMethod ("Install", inParams, None)
print retVal ["ReturnValue"].ToString()
<><>PROBLEM>:
[Machine A] --- Where I am running the script, and want to host the .msi file
[Machine B] --- where I want to install the application
So, How can I define the UNC path for local machine ? what will be inParams["PackageLocation"] = ??