Is there a way in xp or a script of some sort that would automatically delete the files on a usb drive when it's plugged in? Or to move the files to another location then delete the ones on the drive?
Automatically Delete Files on a USB drive
you could write a small batch operation for this and run it after you plug in the usb drive. here would be the code for that
copy x:*.* C:yourfolderhereorsomething
del x:*.*
create a file like delusb.bat and insert that code replacing x with your drive letter and replace the folder path that you want the files copied to
you could then maybe add an entry in the autorun menu so you could click on the bat file when you first plug it in..
absolutely :-) If you don't want to use batch, you can use a vb script. Or I could code up a small app that would do it in the same fashion. I'm bored and need something to do anyway.
you could then maybe add an entry in the autorun menu so you could click on the bat file when you first plug it in..
Not sure if I'm saying just the same thing, but can't you also just write an autorun .config, so there won't even be any clicking? He did say automatically...
hmm.. you could write an autorun script and store it on the usb drive. you would have to change the script some so it would not delete the autorun script.
i found this a while back, but i lost the address till recently. Try it, it worked setting an icon for my ipod
http://dailycupoftech.com/usb-drive-autoruninf-tweaking/
assuming you have XP sp2, autorun, context menu items and changing default action should work, although i haven't tried it.
I will throw something together for ya, as I can't find another way to do this without a 3rd party application
yea.. I didn't suggest setting it to the default action as I hate giving windows unfettered permission to do what it thinks I want it to do over all usb type thumb drives etc. But certainly, that's a possibility. I can't wait to see what djwilliams comes up with. The idea could be abstracted to other things you'd like to automate upon connectivity as well. This could be a fun side project.
OK, what I am working on you can do the following
set the drive letter open installtion
set to delete all files, or certain file types
appears in the autoplay menu
ability to use without autoplay
doesnt need to be running in background, or as service
is that what your wanting?
um... dude hasn't posted in a week with about a periodic cycle of 3.. I think you can get creative on this one Djwilliams. Do what you think most people would benefit from.
Hell, while you're deleting things.. why not replace the now empty spots with jpg images of the: 'you just got pwned by the guy who wanted a utility for automatically deleting files when your drive's plugged in' graphic. ![]()
nah.. just kidding.. he's probably only looking for a quick way to clear stuff off his thumbdrive.. probably.
Me on the other hand, am along for the thrill of the ride. ^^
looks great! but damned if I'm going to delete my pron collection without first moving them off my drive... if only some youngster could recommend a way...
Aqua-Soft Forums