Results 1 to 9 of 9

Thread: shutting down and restarting

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    shutting down and restarting

    does anybody know how to shutdown or restart the pc with code.

    thanks.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: shutting down and restarting

    A non api way.
    VB Code:
    1. Shell "shutdown -s -t 00" 'shutdown
    2.  
    3. Shell "shutdown -r -t 00" 'restart
    4.  
    5. Shell "-a" 'abort
    the -t means the time before the shutdown or restart so you can change the 00 to say 20 which will show a message box warning you that it will shutdown in 20 seconds or whatever amount you set.

    casey.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: shutting down and restarting

    tsshutdn /?

    will shut down remote machines, too.

  5. #5
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: shutting down and restarting

    Only Authenticated USERs..

  6. #6
    Hyperactive Member notquitehere188's Avatar
    Join Date
    Dec 2004
    Posts
    403

    Re: shutting down and restarting

    its not working
    says filenot found
    It's not just Good, It's Good enough!



    Spelling Eludes Me

  7. #7
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: shutting down and restarting

    notquitehere188, what are you refering to ?

    casey.

  8. #8
    Hyperactive Member notquitehere188's Avatar
    Join Date
    Dec 2004
    Posts
    403

    Re: shutting down and restarting

    VB Code:
    1. Shell "shutdown -s -t 00" 'shutdown
    2.  
    3. Shell "shutdown -r -t 00" 'restart
    4.  
    5. Shell "-a" 'abort
    It's not just Good, It's Good enough!



    Spelling Eludes Me

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: shutting down and restarting

    you have to locate the file. if it's here, call it like this:
    VB Code:
    1. shell "c:\windows\system32\tsshutdn.exe "

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