Batch File Help

  Campo1988 13:22 10 Oct 2007

I need some batch file help. I'll create a scenario to help.


I am a worker who handles sensitive personal data of various persons which I use to do certain
tasks in communication with clients and transfering informations to relevant
organisations/companies. After I have finished with said personal data, and it is no longer
needed, either by law (Data Protection) or because I have finished with it, I need to safely
and securely erase the data. I have a shredding program that allows me to shred nearly any
type of file I wish, so I regulalry use this to shred client's personal data. I would like to
create a batch file that would allow me to select any number of files, and shred this data
once it is been finished with.

Here's how the shred program works:

I open the program, then have to either go to File>Add File, then browse for one (or more),
or I can just press the 'Insert' button on my keyboard to insert the file(s).

Next I have to click on the "Shred" button. A small window pops-up asking how many times I
would like the file(s) to be over-written. I select the most secure and safe, which takes
longer, but it most safe and secure.

Then hit "OK" to continue.

Next, another small window pops-up asking me to confirm my actions. Press "OK" to continue.

The program begins shredding and doesn't stop untill all files are shredded.

Once all files have been shredded, another pop-up appears asking me do I want to view the
shred log, to tell me if any errors occured while shredding. At this I can either click to
view, or not.

I need to do this weekly/daily. How can it be done automatically via just opening the batch

How could I create a batch file (if possible) to do all this? (All files being shredded
will be in the same directories each time, so I don't/shouldn't have to browse) - it can
automatically select the files in the directories, and shred them. How can that be done with
a batch file (if at all possible)?

I have seen on the Internet an example of how to include options/choices, and depending on
my choice, will prompt the batch file do do this or that.
I think that would obviously be used for the options of how secure I wish to shred files.

One final piece of information:

Win'XP SP2.

Please help!


  Diemmess 13:45 10 Oct 2007

Have you any choice of database to enter these records?

From what you say Excel or Access would allow you to find any records in a column which carries some inserted character indicating this is a record for deletion.

Deletion from an active database using either of these MS products is pretty final.

  Campo1988 13:52 10 Oct 2007

No, I'm not actually as described in my first post. I don't actually use personal data, I find it easier to explain things with examples. Sorry for that misunderstanding! I don't "get" Excel, and especially Access. Is there a batch file sort of way to help with what I wish to do?

  Diemmess 14:00 10 Oct 2007

Ther maybe batch files to suit, but I was looking at the problem and a way to destroy sensitive material using facilities which you might already have.

Excel or the more elaborate Access, are two parts of MS Office Pro and are used by thousands to enable a searchable printable way of handling data.

What Application do you use for your purpose?

  silverous 14:03 10 Oct 2007

It sounds like each person's data is in a separate file (e.g. a word document) ?

You then shred the whole file which overwrites it on disk to securely erase it?

It sounds like the tool you are using has a graphical interface - you can get tools that record sequences of clicks etc. but to get it to choose the correct files automatically etc. would be quite complex.

I think it would be better if you can find a command-line version of a secure erasing tool (I know for example "Eraser" has a command line version) then write a batch file - you need to think about the criteria for erasing though. e.g. do you have a folder full of files and you only want to delete a certain client? Or several clients? How are you going to communicate which to the batch file?

  Campo1988 15:05 10 Oct 2007

Note: I don't see any "quote" or "Bold", "Italic" or "Underline" options on the page, so I
have used quote marks instead.

I'm only asking this so I can use a batch file to do it more effeciently, instead of wasting (more) time


"Excel or the more elaborate Access, are"

Program I don't use. Mainly because I am useless at them. Even more so, and especially Access.

"What Application do you use for your purpose?"

Do you mean to securely delete files? I use a program called Simple File Shredder.

click here


"It sounds like each person's data is in a separate file"

Yes, there is/are multiple files/documents.

"You then shred the whole file which overwrites it on disk to securely erase it?"

Correct. In the link/URL above you can see US DOD, Gutmann and Custom. In this order, they
shred files 7, 35 and, as you can see 1, 2 or 3 times before erasing them - also with the
latter, it says "the quickest, but also the least secure."

"It sounds like the tool you are using has a graphical interface"

Yes, as you can see in the link/URL.

"you can get tools that record sequences of clicks etc."

I'm interested. How? And how much? My budget is 0. Also, another question: keyloggers ey? Like
the type or similar to the ones that malicious persons use? Obviously in this situation,
non-illegally of course.

"but to get it to choose the correct files automatically etc. would be quite complex."

I thought it would be simple actually, because I only want to do a few commands
but I didn't realise/know it would be complex, which I guess those few commands on a GUI may
equal several more for a CLI application?

"I think it would be better if you can find a command-line version of a secure erasing tool"

I am not familiar with CLI utilities. I have read a few commands, but they haven't stuck in

"then write a batch file"

That was my question - how do I?

"do you have a folder full of files and you only want to delete a certain client? Or several clients?"

There are multiple directories, and more than one file in each directory are needed to be

"How are you going to communicate which to the batch file?"

Exactly. How can I write a batch file? - I don't know!


  silverous 15:40 10 Oct 2007

Thanks for the further info.
The batch file writing is the least of your worries....

Think of it logically and then slot the tools into place - when I asked how you would communicate which files I didn't mean actually how in a programming language I meant, for example, if I asked you "which files do you want me to erase, sir, I am your batch file" how would you tell me? Is it all files in a folder? all files with a certain name? etc. etc. The batch file can't read your mind.

If you look at:

click here

you should be able to run that from a batch file once we establish what instructions you would be giving it.

  Diemmess 15:59 10 Oct 2007

...or at least how often do you wish to expunge all trace of "dead" ones.
If it were a couple a week you wouldn't need to worry about removing all trace, the space would soon be overwritten and a batch file unnecessary.

[silverous is offering you what you want or at least an ingenious way to do it!]

If the number is large then Access is a superb way for those with a deep pocket and ready to face a very steep learning curve.

Your fundamental flaw (as I see it) is trying to make each record a separate file.

I am persisting with a database approach and if you don't want to buy and learn Excel, how about the free Open Office which has Calc as a look-alike for Excel?

Then you have one data file for all your work presenting on screen a series of rows (one for each individual) and a series of columns one for each detail including a marker to delete that complete record at a click.

  silverous 16:07 10 Oct 2007

Diemmess - I think the issue is that their existing process does not involve access. You are proposing a fundamental change to the way they work, which might be acceptable to them, but they don't seem keen to go down that route.

I agree, best to keep data in a database of some kind rather than lots of individual files, but what if - for example, those files are individual scanned copies of mortgage application forms? Not the easiest thing to put into access (although it can be done).

  Campo1988 16:27 10 Oct 2007

I think there is still some confusion. I am not actually a person who deals with sensitive data of clientele. I used that scenario as an example to help me explain my question (Because I find it easier to use examples to explain things)! Sorry for the misunderstanding!!

Yes, SFS (Simple File Shredder) has the option called Gutmann which is also based on Peter
Gutmann's paper "Secure Deletion of Data from Magnetic and Solid-State Memory".

As fas as I know, Eraser has options that I don't think SFS has, like scheduled shredding.

"To erase unused disk space (files that have only previously been deleted)"

Does that mean files that have just been deleted from the Recycle Bin?

"Eraser uses the 'Darik's Boot and Nuke' disk option"

I have read about this also. You can copy it to floppy also can't you? That is a very good
way to erase ALL traces of data. I know that people/sites/I guess even Uncle Bill himself
(Well probably not, he would con you about it) have said if you format your HDD, it doesn't
erase data, just resets the file table thing, and you can recover files. How about if you
format it, say 10 times? That would make it much more dificult to restore files? I know it
does on floppy, someone told me when doing a full format on floppy, it puts a magnet accross
the floppy to erase data, while quick format just erases the first character of filenames.
According to you, is that correct?

If format HDD 10 times will make it much more dificult to restore files, I guess Darik's Boot
and Nuke does the same thing, but in less time?

I'm still a little scheptical if I were to use it though, because, like I said, formatting
HDD doesn't erase data, how can a program on a floppy erase all data, SAFE & SECURELY and

Perhaps I should even just get quite a strong magnet, and use that on my HDD if I ever wish to
paranoid-ingly erase data? Just to make sure?

  Diemmess 17:08 10 Oct 2007

Ultimately it is your choice, but from what you have told it does seem a shade overkill to be so concerned about elimination of all data traces.

Once deleted (bin emptied too) it is going to take some serious work and prolonged unauthorised access to your computer to recover any sensitive information. If you ever part with your HD, a club hammer and cold chisel will be enough.

silverous - thanks for your explanation of what form the records might take.

The mind boggles at holding such incendiary data.
I'll burrow back home just peeping an eye out to how this thread goes!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

WPA2 hack: How secure is your Wi-Fi?

HP’s new Surface Pro rival is designed specifically for Adobe-using designers and artists

Best kids apps for iPhone & iPad

Que faire si son iPhone ou iPad est tombé dans de l'eau ?