Ioannis Posted June 29, 2008 Posted June 29, 2008 Hi how can i make a script that will check what drives are available on the system and then delete all the files of the drives?
Anonymouse Posted June 29, 2008 Posted June 29, 2008 Hi how can i make a script that will check what drives are available on the system and then delete all the files of the drives?Sounds like it can be quite malicious. I don't think you will get much help here - especially without any sample code. children may smile; the wise ponder- Dr. Holmes of Hardvard Medical School on an Ether BingeLove Makes The World Go Round?So does five shots of tequila. What's your point?[quote name='Valik' date='Jun 5 2008, 05:13 PM']wraithdu, 24 hours. Said I have a bad attitude, just driving the point home with a ban.[/quote]This is classic. :)
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 i need for example if on my system there is drive d to delete all the files from the drive d
TehWhale Posted June 29, 2008 Posted June 29, 2008 How about read the helpfile some, show us some code that you tried, and you may get some help. Why exactly would you want to get all the drives, and delete every file off every drive?
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 i have an old PC that my 2 young brothers use it.It is on my home Network and many time after some days the drives are full with unused files so i need something like this.
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 if anyone can help it will be great pleasure for me!thanks
TehWhale Posted June 29, 2008 Posted June 29, 2008 (edited) How about read the helpfile some, show us some code that you tried, and you may get some help. Why exactly would you want to get all the drives, and delete every file off every drive? To get you started, read the helpfile for these functions. DriveGetDrive() _FileListToArray() FileDelete() Edited June 29, 2008 by JasonB
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 thanks a lot i will make some code using these functions and if i need help i will tell you!thanks again for your time!
Danny35d Posted June 29, 2008 Posted June 29, 2008 i have an old PC that my 2 young brothers use it.It is on my home Network and many time after some days the drives are full with unused files so i need something like this.If what you are looking is to free up some hard disk space then try CCleaner AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
TehWhale Posted June 29, 2008 Posted June 29, 2008 I decided to make this in a few minutes. It will remove all directories, and files, from all drives that are NOT your home drive. #Include <File.au3> $Drives = DriveGetDrive("All") For $i=1 To $Drives[0];Saying from drive 1 until the end of the drives, $Drives[0] If Not $Drives[$i] = @HomeDrive Then $FilesArray = _FileListToArray($Drives[$i], "*.", 2) For $u=1 To $FilesArray[0] DirRemove($Drives[$i]&"\"&$FilesArray[$u]) Next $FilesArray = _FileListToArray($Drives[$i], "*.", 1) For $b=1 To $FilesArray[0] FileDelete($Drives[$i]&"\"&$FilesArray[$b]) Next EndIf Next
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 thank you so much! i dont have words to say.Thanks again for your time although i am reading the documentation of Autoit you post it firstly.so thanks a lot!
Ioannis Posted June 29, 2008 Author Posted June 29, 2008 I just tried yours bit it doesn't do anything to all the other drives!
Moderators SmOke_N Posted June 29, 2008 Moderators Posted June 29, 2008 I just tried yours bit it doesn't do anything to all the other drives!You have no reason to delete drives... well no viable reason anyway. Do not post or ask for it again. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts