I just got notified of a school project in which we need to create a product and make a commercial for it.
I was thinking about making a batch file that defragments your hard drive (among other things) and in the end speeds up your computer.
I just have 2 problems- What to put in this file (what should it do) and how to put it into the file (obviously it has to actually work)
That's where you guys come in.
Can anyone suggest something that should go in this batch file? Please include instructions for how to use the code in your response.
Thank you.
Project for school
Moderator: DosItHelp
-
- Posts: 7
- Joined: 20 Feb 2012 08:14
- Location: Behind you
- Contact:
Re: Project for school
I suggest you think again.
Windows has things known as API's that do a lot of dirty low-level operations to the system and to the HDD.
Commercial Defragmenters use those API's because otherwise by the time Defrag has chosen an empty track/sector for a move,
Windows may have already leapt in and written something vital that should not be over-writen
I doubt that those API's are accessible to a batch file running under CMD.EXE running under Windows.
If you did have access to those API's, then after your first use and inevitable "gotcha" you will have to :-
Format the HDD;
Install Windows;
Install Applications;
Restore user documents.
Windows has things known as API's that do a lot of dirty low-level operations to the system and to the HDD.
Commercial Defragmenters use those API's because otherwise by the time Defrag has chosen an empty track/sector for a move,
Windows may have already leapt in and written something vital that should not be over-writen
I doubt that those API's are accessible to a batch file running under CMD.EXE running under Windows.
If you did have access to those API's, then after your first use and inevitable "gotcha" you will have to :-
Format the HDD;
Install Windows;
Install Applications;
Restore user documents.
Re: Project for school
'
try
Can't really help cause I use diskeeper and have it automated with au3 ( which isn't batch ).
try
Code: Select all
defrag /?
Re: Project for school
I agree with Alan. You can't do so much with Batch. The reason is simple. There are only two (perhaps three) sets of things you can use with batch.
- First are the internal functions of cmd.exe.
- Second are the "native" command line tools that come with Windows (you'll find them in the Sytem32 directory).
- Third are other third party tools that accept parameters from the command line.
As Alan already mentioned, you have no access to the operating system except via those tools written in other programming languages. That means, if there is no fitting function or no suitable tool you have no chance to achieve anything with batch. Hence as Alan feared you have no access to WinAPI functions directly (you need a tool that would do this job).
However, I'm not here to discourage you. There are some minor things you could try with batch.
DEFRAG, CHKDSK, CHKNTFS (defragging, checking disk)
DEL, RD (erasing empty/temporary files/folders)
Perhaps somebody else could propose additional possibilities.
Regards
aGerman
- First are the internal functions of cmd.exe.
- Second are the "native" command line tools that come with Windows (you'll find them in the Sytem32 directory).
- Third are other third party tools that accept parameters from the command line.
As Alan already mentioned, you have no access to the operating system except via those tools written in other programming languages. That means, if there is no fitting function or no suitable tool you have no chance to achieve anything with batch. Hence as Alan feared you have no access to WinAPI functions directly (you need a tool that would do this job).
However, I'm not here to discourage you. There are some minor things you could try with batch.
DEFRAG, CHKDSK, CHKNTFS (defragging, checking disk)
DEL, RD (erasing empty/temporary files/folders)
Perhaps somebody else could propose additional possibilities.
Regards
aGerman