Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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.

Posted

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.

Posted
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...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...