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

Software executed using subprocess.Popen() or os.system() may encounter errors due to DLLs. #100191

Open
nozomichi00 opened this issue Dec 12, 2022 · 3 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@nozomichi00
Copy link

Bug report

The following two lines of code execute the software, but the software fails midway due to a missing DLL: "Failed to execute 'regsvr32 /s CommonEvent.dll'".

subprocess.Popen('C:\\BackUp\Backup.exe', shell=True)

os.system('C:\\BackUp\Backup.exe')

擷取
When manually executing C:\BackUp\Backup.exe, the program runs and completes its task without issue. I have looked for a solution but have not been able to find the cause of the problem. I would appreciate any help.

Your environment

OS: Windows10
Python 3.11.0

@nozomichi00 nozomichi00 added the type-bug An unexpected behavior, bug, or error label Dec 12, 2022
@eryksun
Copy link
Contributor

eryksun commented Dec 12, 2022

Are you running 32-bit Python? Are you running the app distribution of Python from the Microsoft Store? Where is "CommonEvent.dll" located?

@nozomichi00
Copy link
Author

Thank you for your help. I used auto-py-to-exe to package the following items, but this error occurred when running in the Windows 10 environment.
https://github.com/nozomichi00/AutoSoftwareUpgradeTool
image

Are you running 32-bit Python?
→ I am running on Windows 10 x64 environment.

Where is "CommonEvent.dll" located?
→ This file is located at C:\XXXX\Bin, which is not a default location for Windows files.
→ I am truly sorry that I am unable to provide you with this file.

I have been self-learning to code for half a year, and I think I lack basic knowledge.
In manual execution, C:\BackUp\Backup.exe can use "CommonEvent.dll".
I think there is a difference between using Python's subprocess.Popen() and os.system() and manually starting it, but I don't know where the difference is.

I would appreciate it if you could provide me with some clues. Thank you very much.

@nozomichi00
Copy link
Author

I have found that the subprocess.Popen() and os.system() functions in Windows 10 may have difficulty obtaining the highest privileges.
However, I have not yet found a solution to this problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants