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).

Ironwing
  • 23
  • 4
  • Here is the similar topic, might be you can find something useful there. https://community.spiceworks.com/topic/430295-disable-cmd-for-all-users-but-administrators – moni9 Dec 01 '17 at 17:42

1 Answers1

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