I need a code in vb6 to have a program that will auto-delete all the files in 1 drive in just one click of that program?? can u help me???
You need to use the FileSystemObject of the Scripting Runtime library. See here. This library is not part of the standard VB references by default so remember you will have to find it in the "References" list and check it so that it is added to your project; it is under "References" as "Microsoft Scripting Runtime Library". However bear in mind that calls to delete files from a VB app are high-level requests to the O/S, not direct kernel commands. If you have any kind of file lock contention you won't be able to delete a given file.
The best way to blast an entire drive would be use the DOS 'format' command. You cannot run 'format' though on the system drive, and it will take longer to format a drive than to erase all files, though formatting will really do it. You would use the Shell command in VB to execute the DOS command.
See here and here.
You can also use the Shell command to execute the "del" DOS command recursively against the drive. The FileSystemObject is basically doing that under the covers, so it's not too far away. Finally, you can use API code to do it, though I am guessing you are not quite there yet in your experience. But if so, take a look at these articles:
Posted on Apr 01, 2008
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
Jun 17, 2012 | MurGee Auto Clicker MurGee
on May 01, 2010 | Microsoft Internet Explorer 7
May 11, 2011 | Computers & Internet
Sep 04, 2009 | AMD Athlon 64 LE-1640 Processor...
Mar 18, 2009 | E-Machines eMachines Desktop PC
Mar 18, 2009 | Computers & Internet
Mar 11, 2009 | Sony Playstation 3 (PS3) Console
Mar 31, 2008 | Computers & Internet
Feb 25, 2008 | Panasonic KX-T7630 Corded Phone
Nov 13, 2007 | Toshiba Satellite A135-S2386 Notebook
271 people viewed this question
Usually answered in minutes!
Step 2: Please assign your manual to a product: