def detect_vmware():
detected = False
# try:
# with OpenKey(HKEY_LOCAL_MACHINE,
# r"HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port 0\\Scsi Bus 0\\Target Id 0\\Logical Unit Id 0") as key:
# print 1
# except Exception, e:
# print(e)
try:
with OpenKey(HKEY_LOCAL_MACHINE, r"SOFTWARE\\VMware, Inc.\\VMware Tools") as key:
detected = True
except Exception, e:
pass
## print(e)
windows_path = os.environ['WINDIR']
if os.path.isfile(os.path.join(windows_path, r"system32\drivers\vmmouse.sys")) or \
os.path.isfile(os.path.join(windows_path, r"system32\drivers\vmhgfs.sys")):
detected = True
return detected
评论列表
文章目录