Results 1 to 7 of 7

Thread: weird shutdown.exe behavior

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width