Link to home
Start Free TrialLog in
Avatar of mayfieldjr
mayfieldjrFlag for United States of America

asked on

KILL command vs Delete

I have  highly fragmented LARGE (some over 100 MEG) files on my PC.  I used the explorer to delete them then went to the recycle bin to delete them from there.  It takes FOREVER.

What might be the ramifications/differences in using the "KILL" command vs the delete - recycle bin delete?

I put this question here rather than the OS system area - maybe I should put the question there also?
Avatar of jmantha709
jmantha709

Well, the KILL command will not send the file to the recycle bin...

For performance, I don't really know, but testing it will give you a quick answer...
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
EDDYKT,

The Kill command deletes a file on the disk :

Kill "c:\Test.txt"
Avatar of mayfieldjr

ASKER

I need to know any ramifications of using kill vs delete Recycle delete.  

Maybe Kill does the same thing as SHIFT-Delete?  If SHIFT-Delete does the same thing as KILL then KILL would be faster and I can use it IN the VB program.

Anyone know?
Kill does give you the same result as Shift-Delete so you should certainly use Kill in your VB application
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ohh, you're talking about kill statement not kill command

Confuse me  8->
I must be asking the right questions lately! :  )

I have been getting EXCELLENT answers from more than one person.  They have all been informative and helpful.

IThema:  I am not sure about what you said but it will be interestiong to test it.   I had a 350Meg HIGHLY fragmented file on my laptop.  I deleted it using explorer which sent it to the recycle bin.  That took a while (15 - 20 sec)  then when I tried to delete it from the recycle bin it took over 30 minutes.  The "time left" display came up and always said 25 seconds.  All the while the hard drive was being accessed and the performance monitor said the CPU was running at 100%.  I was doing nothing else on the laptop.   I suppose something else could have been going on in the background (laptop on coprorate network) but I did this over two days. (had a number of LARGE fragmented files)

EDDYKT: If you don't want to go to recycle bin, you can hold the shift key and then do delete
The simple solution and I didn't know that..  Thanks

 egl1044:  I can always count on there being a way to do something using the API.  It is usually the "hard" way unless someone can give you a specific example based on your specific circumstance.  I once tried using the API to disable the screen saver (corporate disables it in the control panel).  It took me a while and help from experts-exchange.  Maybe a book on the subject would help me.

Thanks to all of you.
You're welcome mayfield,

If the file in on the network, it could take a while to move it to the recycle bin, though I'm surprised that one file could take up 30 min. to delete. I've never seen something like that before. There may be a virus scanner running somewhere. Maybe the computer the file is on is also set up to truly delete or scramble the physical files on the drive when it's deleted, so it cannot be accessed later. This is sometimes done because, as I mentioned earlier, a file is physically maintained when it is being deleted; only it's toc entries will be destroyed. There's software available that can still read the physical files (like undelete software). By scrambling or destroying the physical files itself, they are truly deleted and can never be recovered again. This may be corporate policy and it may be a reason why it's deleting so slowly...