2

Let's say there are two accounts on Windows, Admin and User. Im running a program which shutdowns system in some ammount of time (using shutdown /s /t). Is there any way to disable shutdown -a for a User? (Except situation where i disable cmd for User from Admin account - because i want to run program on User).

0

It's not a direct answer, but rather a mean workaround:

Instead of relying on shutdown timed by shutdown.exe, use some custom timing mechanism, either via another scheduled task or via some script, eg. vbscript.

At first step, trigger a timed shutdown.exe as before (or use some custom messaging mechanism), but after a predefined time force shutdown with shutdown.exe /t 0.

  • Oh, you're right! I'm not familiar with vbscript, but i can surely implement a simple timer in my program and force the shutdown with /t 0. Thanks! :) – Ironwing Nov 25 '17 at 12:28
  • And how can I run exe in the background after inputting some data? (in this case time until shutdown) Im programming in c++ – Ironwing Nov 25 '17 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.