After entering the password in Windows 10, Ask how to write a script to enable shutdown or restart

Juwon Heo 1 Reputation point
2022-11-30T00:33:39.933+00:00

265523-264917-image.png

The reference image screen says it can be set as a script...
How do I write a setup script?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,175 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,920 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,838 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. S.Sengupta 17,221 Reputation points MVP
    2022-11-30T02:33:02.697+00:00
    0 comments No comments

  2. Limitless Technology 44,096 Reputation points
    2022-12-02T09:13:26.347+00:00

    Hello there,

    To achieve the goal, you may consider creating a batch file that creates a shutdown computer schedule task and then deploying the batch file to all clients by using the startup script. we may create a bat files schedule to reboot the client computers.

    Step 1: Create a batch file to generate a scheduled task

    1. On your domain control server, open the notepad, and enter the command below:

    schtasks /create /ru <administrator> /rp <password> /sc dialy /st 23:59:00 /tn shutdown /tr "shutdown /t 0 /r"

    Please replace the <administrator> and <password> in the above command line by the actual user name and password that you would like to let the schedule task to run.

    1. Save this file as reboot.bat.

    Step 2: Assign a startup script to run the batch file

    Similar discussion here https://social.technet.microsoft.com/Forums/windows/en-US/3608dd77-3727-4cc6-b3c6-cfcf1a486a2a/restart-computers-via-gpo?forum=winserverGP


    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments