| 1. |
Solve : Is One Second too quick for "SHUTDOWN -s -t 1"? |
|
Answer» To shutdown the P.C. I launch a script to run various things that tidy up and remove junk, Is it just as safe to use a 1 Second countdown ? Why wait at all? I customarily shut down using a batch file; I have the delay set to 0. I have been doing this for 6 years in XP, Vista and Windows 7. Windows won't trip the power until it is safe to do so. Quote from: ALAN_BR Is there something important that may take 10 Seconds to complete in the background ? The delay chosen by shutdown -s -t N is number of seconds before Windows commences the shutdown procedure. Nothing happens during that time, other than the display of a message to the user. You might as well skip it altogether if you know you want to shut down and you don't need to save any data. Thank you. I thought one second should be legitimate, but have often come to grief when I attempt a value of zero where the code only expects 1 to 255. Zero Seconds it is then. I am sure that when I launch my script there "should" be nothing that needs to be saved. If I reconsider during the script I can immediately close and abort the script. I just do not see how a final 10 second countdown would allow me to see that a file needed closing, or to tell an application to close its files - and even if I could see, am I not logged out with zero authority once the countdown has started ? I have never managed to close down/abort the countdown, even the top right close button does nothing. For many years Windows 98 would give me, every day, a random selection of BSOD Lost Clusters Reprimand for not closing down windows properly Continuous never ending idle when I told it to shutdown, and I had to pull the plug when the janitor came to lock up the office. I have not learnt respect for Windows, but I have learnt to be wary of the grief and misery it imposes without warning ! ! ! I am not a trail blazer, but am happy to follow in your footsteps. Thank you Regards Alan Quote from: ALAN_BR on July 17, 2010, 11:34:44 AM am I not logged out with zero authority once the countdown has started ? Quite the reverse. If you open a command prompt, and type shutdown /? (This is quite safe, as is just typing shutdown on its own, which has the same effect) you will see all the options available. One of these is shutdown /a (a is for abort) which immediately terminates any pending shutdown. The help states that the /a switch is only usable during the "time-out period", in this context this is the number of seconds which were specified at the command prompt or in a script with the -t option. Note that in the Windows 2000 and XP help the options are preceded by a dash, (e.g. shutdown -s -t 10) whereas in Vista, Windows 7 etc a slash is used (shutdown /s /t 10) but in fact you can use either format. Try this - open two command prompt windows and position them side-by-side. In one, type shutdown /s -t with some suitably large number e.g. 300 (five minutes). Observe the information box that appears. In the other command window, type shutdown /a and see what happens. I imagine a reason for having a short delay might when you are pretty sure the user will be looking at the screen (e.g. it is you) and you just want to assure them or yourself that the shutdown (or shutdown and restart) is actually going to happen, and a longer one might be where you want to give the user plenty of time to save any work that might be in progress. Remember that shutdowns can be triggered remotely over a network by a system admin, who might for example give everybody an hour to get everything saved and log out. As the help makes clear, the options include the ability to include "reasons for shutdown" information. .I am sorry that I doubted the "help" from "SHUTDOWN /?" and also your own advice. My previous experience was that I had zero control once the countdown commenced. I find that the top right corner still does not close the countdown, but I now have the ability to launch CMD.EXE and abort the shutdown, which was not possible last year. Most system changes I put down to a Patch Tuesday update, but I think on this occasion it is what I did before SHUTDOWN. To close down I simply double click a desktop icon (visible because all tasks are CLOSED). This icon launched a tidy-up script which concluded by running CCleaner /AUTO /SHUTDOWN That purged temporary and unwanted files automatically without interaction, and then shut down the computer - 95 times out of 100. There must have been a race hazard somewhere, and on the failure occasions :- Task MANAGER showed that about 5 normal process.exe were missing ; and repeating the launch of the tidy-up script never succeeded, some service or process *.exe was no longer available to support CCleaner. I then created a pure SHUTDOWN script with the single command SHUTDOWN -s -t 10 I then found that whenever "CCleaner /AUTO /SHUTDOWN" failed my new shutdown script would always shut down. I decided that the pop-up screen was totally wrong because :- 1. The top right corner "X" fails to close that window / application as it should, 2. There was no way I could do anything to save the documents as it suggested. I now realise that criticism 2 is only true if CCleaner has caused 5 services to stop. Those 5 services did not seem to be REQUIRED for me to view files and launch task manager etc etc., and "SHUTDOWN -s -t 10" would still operate. I now deduce that whilst Windows is closing down because "SHUTDOWN -s -t 10" told it to do so, some further bits of Windows were closed, and it is probably the loss of these bits in addition to the loss of 5 services which has destroyed all my interactive control My new tidy-up script no longer gives CCleaner the /SHUTDOWN argument, and concludes with the new line SHUTDOWN -s -t 1 I like about 1 second to see it go, and I have never yet thought within 10 seconds of something I forgot to save ! ! Regards Alan I am not convinced that programs like CCcleaner are a good idea. Many people think that gee-whiz "registry cleaners" do more harm than good, that they sometimes cause more problems than they prevent. I do not oppose that view. For my /AUTO mode I use a very light profile that only zaps stuff that I know is not needed, and all the flash cookies that always arrive, and all the Firefox caches in the User profile. This gives me the benefit that my daughters music and video downloads that filled her caches are erased when she shuts down, leaving more free disc space for me (and vice versa). I have a more serious manual mode which is more stringent, but I always scrutinise the analysis and use Google to investigate anything that CCleaner has not previously offered to purge, and only commit to a clean after un-checking any items I have doubts about. The registry was the dreaded end. I only had a cautious cleanse (with backups) before un-installing something, and after un-installing when CCLeaner told me of things that had been left behind when something was removed, I believed it and let it purge them. In my view registry cleaning is no longer the worst bogeyman. There are new kid's in the block :- Secure multi-pass erase ; and even worse Wipe Free Space. I find it incredible that new users of CCleaner are so eager for a new experience they go for maximum effect, and check all the boxes which for safety are NOT checked on a fresh install. They even believe that Wipe Free Space will somehow make more free space available for them to use - and then after the disc has been chundering away for a few hours they abort to see what has been happening and find the entire free space has been lost. Eventually they find the CCleaner forum and users explain what a bad idea it is and point them to documentation, and explain that the free space was overwritten with a monster file that would have been deleted had they allowed CCleaner to finish its work. You just have to cry - or laugh - take your choice ! ! Having said all that, I trust CCleaner as being much safer than many of the expensive cleaners that the naive grab as today's giveaway on GAOTD and similar sites. Regards Alan |
|