|
-
Aug 7th, 2008, 09:46 AM
#1
weird shutdown.exe behavior
If you are not familiar with shutdown.exe, it is a command line exe that you can use to shutdown a windows system.
If you run it from the command line with no params, it gives you the help screen to show you what params you can use.
However there is one param, -t that is for specifying a time to shutdown.
It says the syntax should be
shutdown -t xx (where xx is number of seconds until shutdown occurs)
However, when I run shutdown with -t 30, all it does is log off the user profile instantly. No time wait, no shutdown or reboot, just logs off windows.
This happened on 2 of the machines I tested on.
Anyone have any thoughts? It isn't a blocking issue or anything for me, just thought it was odd.
-
Aug 7th, 2008, 11:40 AM
#2
Re: weird shutdown.exe behavior
Shouldnt the syntax be...
shutdown.exe /t:xx
(no space)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 7th, 2008, 11:47 AM
#3
Re: weird shutdown.exe behavior
I will assume you did a google search and found the MSDN document about Windows 2000 (as I did) with regards to shutdown.exe and its switches.
However if you go to a command line in WinXP and type
shutdown.exe /t:10
it does nothing at all.
Also if you go to a command prompt and just type shutdown and hit enter, you get the switch help, which indicates there is a space and no colon between the switch and its value.
-
Aug 7th, 2008, 11:52 AM
#4
Re: weird shutdown.exe behavior
Rob, I think I figured out, that the t switch only works when you specify -s (shutdown) or -r (restart). There may be a few other combinations that will also work with it, I guess you just need to specify the type of shutdown.
I just still think it is weird that if you do a /t xx by itself not long defaults to just log you off, it also does not count down, it does it immediatly, as if you had specified 0 seconds.
A line like this does work to shutdown after a minute
shutdown -s -t 60
-
Aug 7th, 2008, 12:34 PM
#5
Re: weird shutdown.exe behavior
Yea.
But without the s or r then why should it display anything as it doesnt know what you are wanting to do. I thought you had specified that too as I assumed :embarassed:
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 7th, 2008, 01:08 PM
#6
Re: weird shutdown.exe behavior
I can accept that you need to have a -s or -r or -l qualifier when also specifying time. You need to indicate WHAT type of shutdown you want to do, and perhaps a time delay before it happens.
What I just don't get is why when you try to use the time delay without the shutdown type, it defaults to log off the profile, and with no time delay.
-
Aug 7th, 2008, 04:01 PM
#7
Re: weird shutdown.exe behavior
Probably by desige or as a "feature". its safer to have it log off then to have it shutdown by default.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|