• The development of any software program, including, but not limited to, training a machine learning or artificial intelligence (AI) system, is prohibited using the contents and materials on this website.

Shutdown After Defrag?

jeffy777

Forum Addict
Joined
Feb 8, 2005
Messages
6,518
Location
US
Car(s)
'04 Toyota Sienna, crippled people like vans....
Is there a way to make your PC automatically shutdown after it's done defragmenting the hard drive? This would be pretty handy. Maybe there's like a batch file you can run? I'm using XP Home by the way.

I found this after a search, but I can't really tell if it works....

Code:
defrag c:
shutdown -s -t 3 -c "System Shutdown"
exit

I don't think that works because if I run the .bat file then it just loops the defrag command over and over in the cmd.exe screen. However, if I just open up the command propmt and type in "defrag c:" then it defrags, but how can I make it shutdown afterwards?
 
Just wondering, but why?
 
Why do I want to do this? So I can have my computers defragging at night and then shutdown when they're done. They're always at use during the day, so this would be a good plan. Plus, I have big hard drives so it takes awhile and I don't like to do anything on the computer while it is defragging.

Well, anyway, I found a solution that seems to work:
http://www.konradp.com/products/auto_shutdown/

That program will shutdwon your PC at whatever time you tell it to do so. Last night I told it to shutdown a couple hours after I started the defrag and it worked great.
 
Power options in the control panel maybe, set it to shutdown after 2 hours of idle or something like that. Executive Softwares Diskeeper has Power management integration, I think :)
 
I just don't see the big deal about leaving the PC on overnight. I mean, I leave mine on 24/7.

Oh, and defrag more often. I can defrag my 400 GB HD in like 15-30 minutes. :p
 
I guess I'm one of those people that don't like to leave the PCs on overnight....If I'm no using it, I like it to be shutdown.

Yes, Yes, I know I need to defrag more often, I've been moving around a lot of big files lately so defragin becomes more essential. I just don't like to defrag during the day when I have other stuff to do......
 
Actually, there are some people (sites) claiming that defagging your drive isn't that good when using ntfs. Don't know if it's true, but I NEVER defrag my drive. Takes to much time, and I don't even see the difference.
And the syntax (code) that you posted is a solution (just write it in Notepad and save as .bat and then just execute it, so you can do it again whenever you want without problems).

Greetz Johan
 
Viper007Bond said:
I just don't see the big deal about leaving the PC on overnight. I mean, I leave mine on 24/7.

Firstly it's incredibly bad for the environment and also it costs approximately ?800 a year to keep a PC running non-stop.
 
Overheat said:
Viper007Bond said:
I just don't see the big deal about leaving the PC on overnight. I mean, I leave mine on 24/7.

Firstly it's incredibly bad for the environment and also it costs approximately ?800 a year to keep a PC running non-stop.
How is it bad for the environment? And my PC only uses the power of a lightbulb pretty much. It's not like I leave my 2 monitors on overnight.
 
freerider said:
Actually, there are some people (sites) claiming that defagging your drive isn't that good when using ntfs. Don't know if it's true, but I NEVER defrag my drive. Takes to much time, and I don't even see the difference.
And the syntax (code) that you posted is a solution (just write it in Notepad and save as .bat and then just execute it, so you can do it again whenever you want without problems).

Greetz Johan
It's not as big of a deal as back in the day when drives were slow. And the formatting of your drive would make little difference I would think. The data is still on different parts of the drive and requires seek time. By arranging files all in one place, they can just be read all in one go instead of going to 50 places on the drive just to read 1 file.
 
Yea, sorry, my figures were miles off, it's closer to ?200 - but it's still a lot.

As for the environment, every kWh of electricity consumed accounts for 620g of CO2 released into the atmosphere - so you can see where the problem lies here.

I'm a hypocrit here, as I leave mine on too quite often, but you can't argue with the figures.
 
Overheat said:
Yea, sorry, my figures were miles off, it's closer to ?200 - but it's still a lot.

As for the environment, every kWh of electricity consumed accounts for 620g of CO2 released into the atmosphere - so you can see where the problem lies here.

I'm a hypocrit here, as I leave mine on too quite often, but you can't argue with the figures.

?200??? that's (in a rough estimate) $400 USD. Energy prices have to be astronomically higher in Europe, because over the course of a single month, the difference between leaving my machines running all the time and only turning it on when I need to use it is less than $5 USD a month on my electric bill.

Anyway, if I didn't leave my machines on overnight, FinalGear.com's Folding Team wouldnt be in the top 1200 teams :-D
 
lol - that's true :D

Well the official figure for a modern gaming system is ?150, but seeing as Viper's is customised, I'm guessing it would use more. For a standard P4 rig, it's closer to ?100.
 
Well seeing how very little of my power comes from a coal burning plant...

I'm in the Pacific Northwest here. We have tons of dams that produce most of our electricity. :p
 
freerider said:
Actually, there are some people (sites) claiming that defagging your drive isn't that good when using ntfs. Don't know if it's true, but I NEVER defrag my drive. Takes to much time, and I don't even see the difference.
And the syntax (code) that you posted is a solution (just write it in Notepad and save as .bat and then just execute it, so you can do it again whenever you want without problems).

Greetz Johan

Yes, I did save it as a .bat and ran it, but it didn't seem to do anything (see my first post again)

If I don't defrag my drive for about a month or so I can tell a huge difference in performance after I defrag. Otherwise it starts to get laggy when opening programs and accessing large files.

One reason I don't like to leave my computers on all the time when I'm not around is becasue you never know when a fan might go out and if you don't catch it soon that could be bad. Plus, if you figure up the overnight hours that the system runs over time then that's a lot of extra life that you could have gotten out of your components. I guess I'm kind of thrifty in that area and I'm all for saving electricity. I'm not a rich man, so an extra 5 bucks a month makes a difference, believe it or not.

If you sleep 8 hours a night, then that's almost 3000 hours a year that your PC was running while you slept ;)
 
I've been told that it's better for your hard drive(s) if you left the computer on all the time, it increases their wear if you're constantly booting-up every few hours.

With my computer, I leave it on all-day, turn it off while I sleep, my last computer worked for over three years, and probably still would today.
 
Vette Boss said:
With my computer, I leave it on all-day, turn it off while I sleep, my last computer worked for over three years, and probably still would today.

That's exactly what I do. I only shut them down when I know I'm not going to be using them any more for the day.
 
Re: Shutdown After Defrag?

jeffy777 said:
Code:
defrag c:
shutdown -s -t 3 -c "System Shutdown"
exit

That code should work, though I would remove the exit command, not needed, then just windows schedule to run it at what ever time you want, if it's not working, make sure you have enough HD space to actually do a defrag.

if you don't and still want to defrag, add defrag c: -f
 
I thought it should work too, but when I ran the .bat it just flashed the same command over and over ".....defrag c:" until the screen was filled up.

However, when I open the command prompt and just type "defrag c:" it begins a defrag just fine, so I dunno what the deal is. Also doing a defrag from system tools works perfectly as well.
 
jeffy777 said:
One reason I don't like to leave my computers on all the time when I'm not around is becasue you never know when a fan might go out and if you don't catch it soon that could be bad. Plus, if you figure up the overnight hours that the system runs over time then that's a lot of extra life that you could have gotten out of your components. I guess I'm kind of thrifty in that area and I'm all for saving electricity. I'm not a rich man, so an extra 5 bucks a month makes a difference, believe it or not.

If you sleep 8 hours a night, then that's almost 3000 hours a year that your PC was running while you slept ;)

It is most likely less than $5 a month. I can't do a controlled test, where the only difference is the computers, since my roommate turns on air conditioning at inappropriate times (like the middle of winter) and leaves lights on when he goes out for the night.

Also, one of the most damaging things you can do to an electrical device is power cycling (straight from an electrical / computer engineer (so im about 95% sure it's correct). Not to mention, that those 3000 hours a year go to a very worthy cause, Folding :-D.
 
Top