euverve Posted September 8, 2008 Share Posted September 8, 2008 How can I delete files that may exists or not in all drives. Link to comment Share on other sites More sharing options...
Andreik Posted September 8, 2008 Share Posted September 8, 2008 How can I delete files that may exists or not in all drives.A specific location or you want to search for file? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ChromeFan Posted September 8, 2008 Share Posted September 8, 2008 this will remove the file from the root of your all drives. $DISK = DriveGetDrive("ALL") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then FileSetAttrib($DISK[$I] & "\FileName.extention", "-RSH+N") FileDelete($DISK[$I] & "\FileName.extention") EndIf Else MsgBox(0, "Error", "some drive have a problem or is not ready") Next for more info read the help file for DriveGetDrive() and relateds commands. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel Link to comment Share on other sites More sharing options...
Andreik Posted September 8, 2008 Share Posted September 8, 2008 this will remove the file from the root of your all drives. $DISK = DriveGetDrive("ALL") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then FileSetAttrib($DISK[$I] & "\FileName.extention", "-RSH+N") FileDelete($DISK[$I] & "\FileName.extention") EndIf Else MsgBox(0, "Error", "some drive have a problem or is not ready") Next for more info read the help file for DriveGetDrive() and relateds commands. Your code is wrong. Correct is: $DISK = DriveGetDrive("ALL") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then FileSetAttrib($DISK[$I] & "\FileName.extention", "-RSH+N") FileDelete($DISK[$I] & "\FileName.extention") Else MsgBox(0, "Error", "some drive have a problem or is not ready") EndIf Next When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ChromeFan Posted September 8, 2008 Share Posted September 8, 2008 Your code is wrong. Correct is: $DISK = DriveGetDrive("ALL") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then FileSetAttrib($DISK[$I] & "\FileName.extention", "-RSH+N") FileDelete($DISK[$I] & "\FileName.extention") Else MsgBox(0, "Error", "some drive have a problem or is not ready") EndIf Next it was written by me without a editor directly on the web. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel Link to comment Share on other sites More sharing options...
ChromeFan Posted September 8, 2008 Share Posted September 8, 2008 Your code is wrong. Correct is: $DISK = DriveGetDrive("ALL") For $I = 1 To $DISK[0] $STATS = DriveStatus($DISK[$I]) If $STATS = "READY" Then FileSetAttrib($DISK[$I] & "\FileName.extention", "-RSH+N") FileDelete($DISK[$I] & "\FileName.extention") Else MsgBox(0, "Error", "some drive have a problem or is not ready") EndIf Next it was written by me without a editor directly on the web. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel Link to comment Share on other sites More sharing options...
euverve Posted September 8, 2008 Author Share Posted September 8, 2008 it was written by me without a editor directly on the web.Thanks guys, it worked... I just delete the Message Box... Thanks the help... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now