+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, Restart when script completes in Coding and Web Development; Howdee, Continuing my script learning quest... I would like to add the necessary code to force a restart when a ...
  1. #1

    Join Date
    Oct 2007
    Location
    Cambridgeshire, UK
    Posts
    306
    Thank Post
    58
    Thanked 23 Times in 20 Posts
    Rep Power
    17

    Restart when script completes

    Howdee,

    Continuing my script learning quest...

    I would like to add the necessary code to force a restart when a script has completed everything (e.g. installing software etc). All the options I can find at the moment are about 400 lines of code just to do this 'simple' task - an exaggeration I know! Is there a shorter/simple/quicker way to achieve what I want?

    Thanks, Dave.

  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    What language are you using ?
    Using basic batch commands you can use a:

    shutdown -r

    Or Autoit shutdown command:

    Shutdown(6) ;Force a reboot

    All the options I can find at the moment are about 400 lines of code just to do this 'simple' task
    Aggree 100% with that - I've always take the approach of keeping scripts as short as possible.

  3. #3

    Join Date
    Oct 2007
    Location
    Cambridgeshire, UK
    Posts
    306
    Thank Post
    58
    Thanked 23 Times in 20 Posts
    Rep Power
    17
    Quote Originally Posted by mattx View Post
    What language are you using ?
    Sorry, should have mentioned that!

    VB scripts.

    Dave

  4. #4

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    Sorry, should have mentioned that!

    VB scripts.
    Arrr, thats why you are finding examples of bloated code.....:-)
    I never will understand why when looking at VB scripts it takes 10 lines to do something which takes say 2 or 3 in batch or AutoIT...

  5. #5

    Join Date
    Oct 2007
    Location
    Cambridgeshire, UK
    Posts
    306
    Thank Post
    58
    Thanked 23 Times in 20 Posts
    Rep Power
    17
    Ok...shortest code will do then! ;-)

SHARE:
+ Post New Thread

Similar Threads

  1. Scripting services restart.
    By boomam in forum Windows
    Replies: 11
    Last Post: 12th March 2008, 02:08 PM
  2. Remove Restart Option
    By AnnDroyd in forum Windows
    Replies: 7
    Last Post: 20th December 2007, 02:01 PM
  3. Turn off auto restart
    By richard in forum Windows
    Replies: 2
    Last Post: 25th June 2007, 07:49 AM
  4. USB devices cause computer to restart
    By Midget in forum Hardware
    Replies: 9
    Last Post: 17th April 2007, 08:16 AM
  5. USB devices cause computer to restart
    By Midget in forum Hardware
    Replies: 0
    Last Post: 16th April 2007, 10:55 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •