Stupid little annoying thing

20 views
Skip to first unread message

Kurt Buff

unread,
Sep 28, 2023, 4:27:42 PM9/28/23
to ntsys...@googlegroups.com
For *!years!* I've used 'shutdown -r -t 0' to reboot machines.

In the past couple of weeks it stopped working. Inside of a cmd/powershell session it would emit help and indicate I needed to enter a reason code, and wouldn't accept anything. If I used Win+r to issue the command, it just didn't work.

After a bit of experimentation, I found that 'shutdown -r -t 1' works, which is fine, but why the change?

Win10 22H2 mostly, but also seen on Server 2019.

Has anyone else noticed this?

Kurt

Steve Stewart

unread,
Sep 28, 2023, 4:38:23 PM9/28/23
to ntsys...@googlegroups.com
PowerShell
restart-computer “computer name”, “another name”, etc -force 
The -force is useful where a restart fails because someone is logged on etc

Steve Stewart, Senior Systems Engineer, Mob: +44 7768 267260, email: Steve....@ValeSystems.co.uk
Vale Systems, 24 High Street, Burbage, Wiltshire SN8 3AF.  Tel: +44 1672 812000,  www.ValeSystems.co.uk

A Partnership registered for VAT in England – Reg. No. GB 663 4662 20



On 28 Sep 2023, at 21:27, Kurt Buff <kurt...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "ntsysadmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntsysadmin+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsysadmin/CADy1Ce4roxMhhWmhqaXnrM8%2BF21UxTEY0SjNuo75cdp1xKu3ZA%40mail.gmail.com.

Gordon Pegue

unread,
Sep 28, 2023, 4:52:36 PM9/28/23
to ntsys...@googlegroups.com

On a couple of my W10 22H2 boxes Kurt, shutdown -r -t 0 works just fine from a command prompt session…

 

Gordon

 

From: ntsys...@googlegroups.com <ntsys...@googlegroups.com> On Behalf Of Kurt Buff
Sent: Thursday, September 28, 2023 14:27
To: ntsys...@googlegroups.com
Subject: [ntsysadmin] Stupid little annoying thing

 

  [EXTERNAL]

--

Robert ECEO Townley

unread,
Sep 28, 2023, 5:12:16 PM9/28/23
to ntsys...@googlegroups.com
Could it be that someone set the system to send feedback to Microsoft.  
ServiceQualityMonitor.SQM files in $ENV:TEMP may be in an indication. 
May want to look at "ServerManager.exe" --> "Local Server"  --> "Feedback & Diagnostics


--

Lee Wilbur

unread,
Sep 28, 2023, 6:42:57 PM9/28/23
to ntsys...@googlegroups.com

I used to use that command until I realized that occasionally a system didn't shutdown.  Turned out some applications were holding up the reboot.  You could use the /f switch but if you use /t with a value greater than 0, the /f is implied.  As a result, I've used shutdown -r -t 1 for years.


I believe the shutdown command has always required a reason if you don't force it when restarting SERVERS.  Windows client PCs aren't finicky about it.  I remember being annoyed about it when the reason codes first debuted in 2003.  I thought Microsoft lightened up on requiring them, but maybe the /f (or implied /f) bypasses the reason code requirement and I stopped noticing.


In prior versions, you could disable the Shutdown event tracker and since windows is built on top of windows with each iteration, I would expect the disabling still works.  Reference:

https://learn.microsoft.com/en-us/troubleshoot/windows-server/application-management/description-shutdown-event-tracker


-Lee




From: ntsys...@googlegroups.com <ntsys...@googlegroups.com> on behalf of Kurt Buff <kurt...@gmail.com>
Sent: Thursday, September 28, 2023 4:27 PM

To: ntsys...@googlegroups.com
Subject: [ntsysadmin] Stupid little annoying thing

con...@cadzow.com.au

unread,
Sep 28, 2023, 6:56:43 PM9/28/23
to ntsysadmin
In my contemporary scripts I use Shutdown.exe /r /t 1, but I have no recollection why I went to the trouble of using /t 1.
In my much older scripts, which aren't used any longer, I have -r -t 0

Kurt Buff

unread,
Sep 28, 2023, 11:03:03 PM9/28/23
to ntsys...@googlegroups.com
Yep - the PowerShell works, but it's not the first thing that comes to my fingers when doing light maintenance.

Kurt

Kurt Buff

unread,
Sep 28, 2023, 11:03:29 PM9/28/23
to ntsys...@googlegroups.com
I'll take your word for that, but it's not my experience.

Kurt

Kurt Buff

unread,
Sep 28, 2023, 11:04:00 PM9/28/23
to ntsys...@googlegroups.com
Perhaps I need to try it again...

Kurt

On Thu, Sep 28, 2023 at 2:52 PM Gordon Pegue <gpe...@unm.edu> wrote:

Kurt Buff

unread,
Sep 28, 2023, 11:04:46 PM9/28/23
to ntsys...@googlegroups.com
That is worth checking.

Thanks,
Kurt

Kurt Buff

unread,
Sep 28, 2023, 11:05:42 PM9/28/23
to ntsys...@googlegroups.com
Another thought worth pursuing.

Thanks,
Kurt

Michael B. Smith

unread,
Sep 28, 2023, 11:14:29 PM9/28/23
to ntsys...@googlegroups.com

My standard build has “reboot” aliased in both PS and cmd.exe as “shutdown.exe /g /f /t 0” (in versions where /g is supported and /r otherwise).

Philip Elder

unread,
Sep 29, 2023, 6:02:18 PM9/29/23
to ntsys...@googlegroups.com

The command is being run in an elevated CMD or PowerShell?

 

Philip Elder MCTS

Senior Technical Architect

Microsoft High Availability MVP

E-mail: Phili...@mpecsinc.ca

Phone: +1 (780) 458-2028

Web: www.mpecsinc.com

Blog: blog.mpecsinc.com

Twitter: Twitter.com/MPECSInc

Skype: MPECSInc.

 

Please note: Although we may sometimes respond to email, text and phone calls instantly at all hours of the day, our regular business hours are 8:00 AM - 5:00 PM, Monday thru Friday.

 

Reply all
Reply to author
Forward
0 new messages