+ 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
    274
    Thank Post
    52
    Thanked 20 Times in 18 Posts
    Rep Power
    13

    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. IDG Tech News

  3. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    8,472
    Thank Post
    889
    Thanked 890 Times in 532 Posts
    Rep Power
    596
    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.

  4. #3

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

    VB scripts.

    Dave

  5. #4

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    8,472
    Thank Post
    889
    Thanked 890 Times in 532 Posts
    Rep Power
    596
    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...

  6. #5

    Join Date
    Oct 2007
    Location
    Cambridgeshire, UK
    Posts
    274
    Thank Post
    52
    Thanked 20 Times in 18 Posts
    Rep Power
    13
    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, 03:08 PM
  2. Remove Restart Option
    By jwood in forum Windows
    Replies: 7
    Last Post: 20th December 2007, 03: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
  •