Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > To delete all files including rar and zip from external drive

To delete all files including rar and zip from external drive

Forum Windows XP : Windows XP General Discussion - To delete all files including rar and zip from external drive

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Hi sir,


I have a query regarding vbscript.My question is i want to delete all the files including .rar,zip and other when i insert any external media to my pc.Plz help me

Thanks in advance

Sponsored Links
Register or log in to remove.

You can do it with a batch file but your question may be more difficult as you say "any' external media.
If you insert more than one external device you must be concerned with drive letters.

For example del e:\*.rar /s will delete all rar files on the e: drive including all sub directories but if you have a external HDD that is e: and put in a flash card the card will become f: and you may end with undesired results.

Being that external devices insertion can be dynamic I dont think a script can be used.
I believe that it will have to be done manually and with a varible so as to ask which drive do you want to do this to.

Reply to pat mcgroin

pat mcgroin wrote :

You can do it with a batch file but your question may be more difficult as you say "any' external media.
If you insert more than one external device you must be concerned with drive letters.

For example del e:\*.rar /s will delete all rar files on the e: drive including all sub directories but if you have a external HDD that is e: and put in a flash card the card will become f: and you may end with undesired results.

Being that external devices insertion can be dynamic I dont think a script can be used.
I believe that it will have to be done manually and with a varible so as to ask which drive do you want to do this to.



Thanks 4 ur reply, but i am newcommer in this field so will help me to the send code of the script file and how i will attach it with the autorun.inf??

Thankx in advance
basically i hve an external hrd disc so i want to delete all the file automatically when i insert it in my usb

Reply to urparagjyoti

tbh this isnt really the best place to ask for VBscript help, there might be one or two experts here if your lucky, but i would do a search on google and find a vbscript specific forum.

heres some useful sites...


try posting this question here: http://www.tek-tips.com/threadmind [...] 329&page=1

some good examples to look at: http://www.scriptinganswers.com/vault/

------------------------------ :(
Reply to Flakes
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > To delete all files including rar and zip from external drive
Go to:

There are 1223 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them