Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

[How-to] Automate drive maintenance - BETA

- - - - -

  • Please log in to reply
25 replies to this topic

#1
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
DISCLAIMER: This is not a finished product. It has minimal error trapping coded into it. Please look at the code prior to running. If you do not understand the code, you may not want to try these until they are in a more "finished" state.


This works for XP Pro, but I'm not sure about Home Edition/2003/2000. I thought this might be useful since it automates things that people often forget about & people don't have to download any software. I have it running on a couple of machines & it works just fine. It's not as good as some of the stuff you pay for, but it's better than nothing. :)
Maintenance Scripts

NOTE: This is all done through VBScript, now.

Edited by GeneralMandible, 21 March 2008 - 11:18 AM.

"I am the colony!"
My Website


How to remove advertisement from MSFN

#2
eyeball

eyeball

    Have you tried turning it off and on again?

  • Member
  • PipPipPipPipPipPip
  • 1,150 posts
  • Joined 28-October 05
good post!
thanks

Edited by eyeball, 14 June 2006 - 02:28 PM.


#3
New2Autoit

New2Autoit
  • Member
  • 4 posts
  • Joined 14-June 06
hi GeneralMandible

I would like to see how your scripts work, do you mind if you post the source?
Thanks in advance.

#4
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
If you want to look at the code, the easiest way would be to download the .exe and extract the files using WinRAR. I think that might be easier than posting all the scripts in here.
"I am the colony!"
My Website

#5
Zxian

Zxian

    Scroll up - see the Google bar?

  • Super Moderator
  • 5,066 posts
  • Joined 30-September 04
  • OS:none specified
  • Country: Country Flag
Just a suggestion about your download package - make it at least have some sort of prompt before extracting the files. Having it all of a sudden drop a command window in front of you can be intimidating.

Also, try making the "installer" a VBS script. It can run without the big fat window and it'll look more professional. :)

#6
TheFlash428

TheFlash428

    Advanced Member

  • Member
  • PipPipPip
  • 456 posts
  • Joined 15-September 05
nice package--thanks for sharing.
"There are 3 ways to do things: The right way, the wrong way, and the Max Power way!"
"Isn't that the same as the wrong way?"
"Yes--but faster!"

#7
New2Autoit

New2Autoit
  • Member
  • 4 posts
  • Joined 14-June 06
Thanks

#8
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

It's not just adding a prompt that would bother me, here's my initial impressions.

This thing is not very well designed, it uses a strange mix of .reg, .vbs, .bat and .cmd, assumes too much about the system upon which it is going to be blindly run. It doesn't perform sufficient checks prior to running, does things like including hard coded paths, deletes your pagefile, tries to shut down a bucket load of processes, the names for which are just guessed, deletes whatever it wants in the cleanmgr.

I think it still has a good way to go before it should be released to unsuspecting users. The problem is that the type of person incapable of fully understanding the code is also the type of person most likely to want to use your scripts.

#9
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04

It's not just adding a prompt that would bother me, here's my initial impressions.

This thing is not very well designed, it uses a strange mix of .reg, .vbs, .bat and .cmd, assumes too much about the system upon which it is going to be blindly run. It doesn't perform sufficient checks prior to running, does things like including hard coded paths, deletes your pagefile, tries to shut down a bucket load of processes, the names for which are just guessed, deletes whatever it wants in the cleanmgr.

I think it still has a good way to go before it should be released to unsuspecting users. The problem is that the type of person incapable of fully understanding the code is also the type of person most likely to want to use your scripts.

Adding a prompt wouldn't be hard...but is it worthwhile for me to spend a bunch of time making it universal to all systems? making it really pretty like Vista? Not really. I posted these because I figured someone could find them useful. The process/service names were not guessed. They were ones on my systems. People can go in and modify them as they see fit. Stopping them lets things run more smoothly. This is by no means a "finished product." It's just a tool that people can tweak and use as they see fit. I guess I should put a better explaination and disclaimer on it. It doesn't delete the pagefile, it "clears" & disables it (allowing it to be defragged), then reactivates it. As for the mix of files, it was the simplest way to get things done. Eventually I may move it all to vbscript.

If a lot of people would like for this to be put into a Maintenenace interface for XP, I may find it worthwhile to put it into a customizable app as opposed to multiple scripts.
"I am the colony!"
My Website

#10
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Clearing the pagefile on shutdown should mean that it has no information inside it to require defragging!

As you said, the scripts are by no means a finished product, but they don't just need tweaking, they need practically a re-write.

#11
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04

Clearing the pagefile on shutdown should mean that it has no information inside it to require defragging!

As you said, the scripts are by no means a finished product, but they don't just need tweaking, they need practically a re-write.

Clearing the pagefile means writing 0's to all inactive pages. The file can still be fragmented, meaning it is broken into to different parts on the disk.

They work pretty well on all my XP Pro machines for needing a re-write.

I'm guessing you are saying "yes" to putting it into an app. As long as it is completely customizable: install path, cleanup mgr options, pagefile options, etc. It would just be an interface for some of the features built into XP, but more user friendly. Any other constructive ideas of things it should have?
"I am the colony!"
My Website

#12
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

No, I don't care whether it is a series of scripts or an application, I wouldn't be using it anyhow. The problem is that it uses inappropriate or less efficient commands and script types and has no regard for either the user or their system.

The last thing I want to do in order to make a little more space on my system, is to create a new user, log in as them and as a consequence set up a whole new profile folder and contents. I don't want hard coded paths in a reg file, I don't want a folder creating somewhere on the root of my systemdrive without asking and the assumption that my temporary files need removing. I don't want this thing to run at a time and date of your choosing, I don't want processes stopping that don't exist, and I don't want services starting which may already be started. Most of all however, other than a routine to back up one branch of the registry, there is no error trapping at all being used. On this sort of thing, that makes this very dangerous to use.

Edited by Yzöwl, 15 June 2006 - 11:11 AM.


#13
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,421 posts
  • Joined 02-August 03
  • OS:none specified
  • Country: Country Flag
This is a clean and defrag tool I made it a HTA and uses JS and VBS script.
The Thread, to look at the source code
What it looks like
Posted Image
Down Load


GunSmokingMan



#14
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04

The last thing I want to do in order to make a little more space on my system, is to create a new user, log in as them and as a consequence set up a whole new profile folder and contents.

My main goal with deleting temp files is not to save space, but to clean out the garbage that slows things down more than anything. I can have it delete the profile when the user logs in again. I've worked on machines that have over a GB of temporary internet files.

I don't want hard coded paths in a reg file, I don't want a folder creating somewhere on the root of my systemdrive without asking and the assumption that my temporary files need removing.

If people like the premise of automating these tasks, it would be worthwhile to add options for this. As of my initial posting, I was presenting the idea for people to customize as they see fit.

I don't want this thing to run at a time and date of your choosing,

The whole purpose of this is automation. It says in the install that it scheduled the task & that it can be changed.

I don't want processes stopping that don't exist,

Don't worry, this is impossible. No script can stop something that doesn't exist.

and I don't want services starting which may already be started.

If it starts a service that's already started, it's still running. It has no effect on the service.

Most of all however, other than a routine to back up one branch of the registry, there is no error trapping at all being used. On this sort of thing, that makes this very dangerous to use.

This I agree with...there is no error trapping...yet. You are assuming this to be a finished piece of software. They are just a set of scripts to automate some monotonous tasks. I agree that error checks need to be added to this. If this was scripted in VB with error trapping, asked the user lots of questions, & was highly configurable, would it be of use to a lot of people?
"I am the colony!"
My Website

#15
Andromeda43

Andromeda43

    Retired PC Tech.

  • Member
  • PipPipPipPipPipPip
  • 1,018 posts
  • Joined 14-August 05
  • OS:XP Pro x86
  • Country: Country Flag
General Mandible,
I have the utmost respect for anyone who does anything meaningfull to try to help others clean up their PC's.

Crap in the gap and junk in the trunk does more to slow down and corrupt a PC than all the viruses and spyware in the world.

I've been writing cleanup batch files for years to keep my own pc and those of my friends and customers clean and running at peak performance.
My little "Hoover.bat" program for windows 98 is now running on thousands of PC's in over 9 countries that I'm personally aware of.

My "XPCleanup.bat" program that I put on my own website is being used by many.
It deletes all the real "Junk" stuff from the HD.

Programs like windows "Disk Cleanup" and "Defrag" can just be programmed into the task Scheduler for a daily cleanup and a batch file like my "XPCleanup.bat" can be put into the Startup folder for a quickie cleanup every time the PC is rebooted.
Lines can easily be added to dump things like AV Quarantine folders, IM Cache folders, etc.
I have all that stuff in my own XPCleanup.bat file on my PC. I even added a line to dump the cache folder for my "Call Wave" program, that wants to save every message I receive on my phone while online.
All that cached stuff can kill a system if not dealt with on a regular basis. All it takes is a simple batch file in the right place (like the startup folder) to do the job.

All together, a system can be kept pretty clean and defragged without any real operator intervention.

For my own customers, I give them several cleanup and reorganize programs in a weekly cleanup routine.
I then give them a printed sheet of instructions on just how to run the routine. It gives them a sence of accomplishment to go through it and know that their PC is 'now' clean, defragged and error free.

Keep up the good work, :thumbup
Andromeda43 B)
A person with experience is never at the mercy of a person with an argument.

#16
Zxian

Zxian

    Scroll up - see the Google bar?

  • Super Moderator
  • 5,066 posts
  • Joined 30-September 04
  • OS:none specified
  • Country: Country Flag
How about this - GeneralMandible, would you perhaps place a disclaimer in the original post or change the topic title to include something like "BETA". At least that way unsuspecting people don't think that it's a fully finalized setup that'll work for everyone.

Hopefully that'll make more people happy, and encourage more bugtesting and fixing than what I've seen so far.

#17
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,557 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I don't need to worry, I live and breath scripting; the point is that it shouldn't be done like this.

For instance,

check if the service is running, if it isn't start it.
stop all running processes unless they are 'this', 'that' or 'the other'
dynamically create the drive letter to be used.



#18
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
I've added "BETA" and a disclaimer to the original post.

@Zxian
Thanks for the constructive criticism. That's the kind that can be appreciated.
"I am the colony!"
My Website

#19
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
I've made some changes to where it now has a prompt after extraction that asks if you want to install, view the ReadMe file, or cancel. It also deletes the profile (fixed path, but will change later) after the user logs back in. I would like to move this to a VB app, but it might be awhile.
"I am the colony!"
My Website

#20
D8TA

D8TA

    Member

  • Member
  • PipPip
  • 136 posts
  • Joined 18-February 05
How can I modify date and time for the scheduler within the Scheduled Task. I want this to run at 11:59pm every Saturday. Can't find what file to modify to correct this.

never mind I found it and changed it. Thanks again and I look forward to assist with your Beta testing.

Thanks!

Edited by D8TA, 05 October 2006 - 01:33 PM.


#21
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
I'm looking at making some changes to this:
  • Emptying temp files for all user profiles
  • Defragging all local fixed disks
  • Chkdsk on all local fixed disks
I also want to try to move it all to VBscript (no more REG, BAT, CMD files).

I'll post again when I have these three features added.
"I am the colony!"
My Website

#22
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04

I'm looking at making some changes to this:

  • Emptying temp files for all user profiles
  • Defragging all local fixed disks
  • Chkdsk on all local fixed disks
I also want to try to move it all to VBscript (no more REG, BAT, CMD files).

I'll post again when I have these three features added.


I've updated the packages & I was able to accomplish all of these tasks. I finally sat down and looked at putting it into VB and it only took me about a week to get it "working." I still have some error handling to do, but it's working.

I switched the defrag to DirMS due to MS's inability to defrag large files.
"I am the colony!"
My Website

#23
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04
This is working on 2000 Pro & Server and 2003, now. I updated it a few months back.
"I am the colony!"
My Website

#24
Tarun

Tarun

    Spectre

  • Super Moderator
  • 3,189 posts
  • Joined 27-January 04
  • OS:Windows 7 x64
  • Country: Country Flag
Just stumbled across this topic myself but admittedly I have not yet used this.

Do you perform chkdsk before the defrags?

#25
GeneralMandible

GeneralMandible

    Major

  • Member
  • PipPip
  • 223 posts
  • Joined 08-July 04

Do you perform chkdsk before the defrags?

Yep,
Deletes temp files
Disables pagefile
Reboot
Chkdsk
Defrag
Enable pagefile
Reboot
Cleanup when you login - this step only takes a couple of seconds
"I am the colony!"
My Website




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users