A Desktop Shortcut to Shutdown

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

A Desktop Shortcut to Shutdown

Post by hlewton »

For years I have used a desktop shortcut to shut down all versions of Windows since Win 7. This same shortcut has worked fine on all my Win 11 machines until today. It no longer works on 1 on the machines. The properties of the shortcut is %windir%\system32\shutdown.exe -s -f -t 0 Any idea why all of a sudden this quit working and how I can fix it? Thanks
Regards,
hlewton

JoeP
SilverLounger
Posts: 2069
Joined: 25 Jan 2010, 02:12

Re: A Desktop Shortcut to Shutdown

Post by JoeP »

What happens if you type the command in a command prompt?
Joe

User avatar
John Gray
PlatinumLounger
Posts: 5411
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: A Desktop Shortcut to Shutdown

Post by John Gray »

Additionally, check if shutdown.exe is present in %windir%\system32.
Finally, check the value of %windir% !
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: A Desktop Shortcut to Shutdown

Post by ChrisGreaves »

hlewton wrote:
06 Jul 2023, 23:03
The properties of the shortcut is %windir%\system32\shutdown.exe -s -f -t 0 Any idea why all of a sudden this quit working and how I can fix it? Thanks
My Batch file (Win11) still uses

Code: Select all

ShutDown.exe -s -t 00 -f
I have no idea why yours does not work.

Cheers, Chris
He who plants a seed, plants life.

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

JoeP wrote:
07 Jul 2023, 02:35
What happens if you type the command in a command prompt?
Just found out I cannot run the command prompt as administrator or not as administrator. It will not open either.
Regards,
hlewton

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

ChrisGreaves wrote:
07 Jul 2023, 06:00
hlewton wrote:
06 Jul 2023, 23:03
The properties of the shortcut is %windir%\system32\shutdown.exe -s -f -t 0 Any idea why all of a sudden this quit working and how I can fix it? Thanks
My Batch file (Win11) still uses

Code: Select all

ShutDown.exe -s -t 00 -f
I have no idea why yours does not work.

Cheers, Chris
Thank you but now I am concerned why I cannot open the command prompt.
Regards,
hlewton

User avatar
stuck
Panoramic Lounger
Posts: 8178
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: A Desktop Shortcut to Shutdown

Post by stuck »

My Win 10 Pro Desktop shutdown shortcut is:

Code: Select all

%windir%\System32\shutdown.exe -s -t 00
and it works fine. I originally created it for my Win XP system (or perhaps even my Win 98 one).

I note your shortcut you say your shortcut ends "...-t 0", i.e. it only has a single zero on the end, whereas mine and Chris's includes a double zero. Is that a typo you've made in your post?

Ken

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

stuck wrote:
07 Jul 2023, 11:05
My Win 10 Pro Desktop shutdown shortcut is:

Code: Select all

%windir%\System32\shutdown.exe -s -t 00
and it works fine. I originally created it for my Win XP system (or perhaps even my Win 98 one).

I note your shortcut you say your shortcut ends "...-t 0", i.e. it only has a single zero on the end, whereas mine and Chris's includes a double zero. Is that a typo you've made in your post?

Ken
Thanks but I believe something other then the shortcut is the problem. Everything else including Microsoft 365 still seems to be functioning but I can't run system files like the command prompt. Not sure how to fix that. If I try opening either the command prompt or that shutdown shortcut, there is absolutely no response to either one of them.
Regards,
hlewton

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

I am keeping my fingers crossed but I hope I got it fixed. I was able to run the command prompt from that option where you can also choose to boot into the Safe mode. I ran sfc /scannow and it said it found and fixed corrupt files. I also tried to run DISM /online /cleanup-image /restorehealth from that same prompt and it would not run saying none of those switches were valid even when I tried running them one at a time. So I booted to the Safe mode and my Shutdown shortcut worked. I booted the machine up and tried running the command prompt as the administrator and it opened. So I tried running the DISM /online /cleanup-image /restorehealth from there and it ran perfectly and gave me the message you can see in the attachment.
dism.jpg
Not sure what all happened here but, again, hopefully I have fixed it.
You do not have the required permissions to view the files attached to this post.
Regards,
hlewton

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

By the way, this is my wife's computer. She NEVER installs anything, just uses Microsoft 365 applications, and almost exclusively, Word. Any idea why this problem happened so it can be avoided in the future?
Regards,
hlewton

User avatar
John Gray
PlatinumLounger
Posts: 5411
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: A Desktop Shortcut to Shutdown

Post by John Gray »

stuck wrote:
07 Jul 2023, 11:05
My Win 10 Pro Desktop shutdown shortcut is:

Code: Select all

%windir%\System32\shutdown.exe -s -t 00
and it works fine. I originally created it for my Win XP system (or perhaps even my Win 98 one).

I note your shortcut you say your shortcut ends "...-t 0", i.e. it only has a single zero on the end, whereas mine and Chris's includes a double zero. Is that a typo you've made in your post?

Ken
Both -t 0 and -t 00 work identically!
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

JoeP wrote:
07 Jul 2023, 02:35
What happens if you type the command in a command prompt?
Joe what were your thoughts when you asked this? As you may have expected, the command prompt did not work. I hope I have it fixed but have no idea why the command prompt would not work? Thanks.
Regards,
hlewton

JoeP
SilverLounger
Posts: 2069
Joined: 25 Jan 2010, 02:12

Re: A Desktop Shortcut to Shutdown

Post by JoeP »

I thought perhaps the shortcut was corrupted or something was wrong with the shutdown applet. You might see an error in the command prompt you would not notice when running via another method.
Joe

User avatar
hlewton
PlatinumLounger
Posts: 3811
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: A Desktop Shortcut to Shutdown

Post by hlewton »

JoeP wrote:
12 Jul 2023, 12:03
I thought perhaps the shortcut was corrupted or something was wrong with the shutdown applet. You might see an error in the command prompt you would not notice when running via another method.
OK, thanks.
Regards,
hlewton