Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qprocess: 32位python程序调用64位操作系统程序问题 #44

Closed
625781186 opened this issue May 22, 2019 · 3 comments
Closed

qprocess: 32位python程序调用64位操作系统程序问题 #44

625781186 opened this issue May 22, 2019 · 3 comments
Labels

Comments

@625781186
Copy link
Collaborator

image
image

@625781186
Copy link
Collaborator Author

625781186 commented May 22, 2019

解决方法:

image

注 :
os.system, os.startfile 之类都不行

@625781186 625781186 changed the title qprocess 64为系统。32为程序调用系统程序问题 qprocess: 32位python程序调用64位操作系统程序问题 May 22, 2019
@892768447
Copy link
Member

QQ图片20190522190151

@892768447
Copy link
Member

import ctypes
import os

redv = 0
try:
    oldValue = ctypes.c_long(0)
    redv = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection(ctypes.byref(oldValue))
    print(oldValue, redv)
except:
    pass

os.startfile(r'C:\Windows\System32\osk.exe')

if redv:
    try:
        ctypes.windll.kernel32.Wow64RevertWow64FsRedirection(oldValue)
    except:
        pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants