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

Restart code does not work properly #2

Open
ygoe opened this issue Aug 13, 2016 · 1 comment
Open

Restart code does not work properly #2

ygoe opened this issue Aug 13, 2016 · 1 comment

Comments

@ygoe
Copy link
Owner

ygoe commented Aug 13, 2016

The restart code with ExitWindowsEx as in v1.0 worked fine in Windows 7. In Windows 10 is logs off the user but does not restart the computer. This has been changed in v1.1 but now it always fails with error 1314 (“A Required Privilege Is Not Held by the Client”). A fallback method (call shutdown.exe) is in place. This needs proper testing on all systems and cleaning up. Maybe only the current fallback method should be used everywhere.

@ziggythehamster
Copy link

You need to acquire your token and then AdjustTokenPrivileges before the system will honor your reboot request. Here's an example in C but converting it to C# should be super easy.

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

No branches or pull requests

2 participants