Sunday, 25 March 2018

windows 10 - Script to turn fast startup on/off


I am dual-booting with Windows 10 + Ubuntu. The problem is that if Windows' Fast Startup is on, Ubuntu won't load. If it is off, it will take Windows some 7 minutes to start next time. So it is faster for me to turn it off on, because I use them in periods usually.


I would like to have a batch file that will toggle the fast startup on/off.


Is this possible?



Answer



Fast startup is only used if you use the Shutdown option in the start menu.


Fast startup will close all programs, then hibernate windows.


Starting up the computer will then resume the hibernation state if you choose to boot Windows 10.


If you are in windows and choose reboot, Fast startup is not being used, as windows is not being hibernated.


So in theory you can boot to windows quickly, then reboot and boot to Ubuntu normally.


That said, if you hold shift while pressing shutdown in the startmenu, hybrid shutdown is disabled for one shutdown. So windows is exited normally and then powered off, allowing you to start the pc the next day and boot directly into ubuntu. If you then choose to boot into Windows instead, the boot time will obviously be longer too.


But if you really want to use a batch script, then you can also do that.


Here are 2 interesting commands you can use:


shutdown /s          <- will shut down the pc normally.
shutdown /hybrid <- will perform a hybrid shutdown.

use shutdown with options /t 0 for turning it off immediately. Use /f to force the shutdown. If time is set or the parameter is ommitted, shutdown /a can abort the shutdown. By default, there is a 1 minute time out.


Lastly, if you disable hibernation globally, hybrid shutdown will be disabled too.


To do this from a commandline, use:


powercfg /hibernate off      <- will turn off hibernation support
powercfg /hibernate on <- will turn on hibernate support

See powercfg /h /? for more info.


No comments:

Post a Comment

Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...