zFrank Posted August 20, 2008 Posted August 20, 2008 hi, anyone please tell me that how can i delete some Hidden files in a folder these files have +SHR attribute. because for deleting first i need to make them normal, i dont know the names of files, i just know their extension. now let me know how to delete them. thanks a lot in advance for help! [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk"
Andreik Posted August 20, 2008 Posted August 20, 2008 hi, anyone please tell me that how can i delete some Hidden files in a folder these files have +SHR attribute. because for deleting first i need to make them normal, i dont know the names of files, i just know their extension. now let me know how to delete them.thanks a lot in advance for help!Look in DOS about DEL or ERASE comand. Both are options for files with attributes.
zFrank Posted August 20, 2008 Author Posted August 20, 2008 but these commands will also delete other files... i want to do it using autoit. [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk"
weaponx Posted August 20, 2008 Posted August 20, 2008 but these commands will also delete other files... i want to do it using autoit.What are you talking about? These commands delete only the files you specify.
LongBowNZ Posted August 20, 2008 Posted August 20, 2008 (edited) or u can use file delete "*.SHR" Don't do that!EDIT: He said the files have the attributes SHR not the extension SHR Edited August 20, 2008 by LongBowNZ
zFrank Posted August 21, 2008 Author Posted August 21, 2008 but after setting the attributes of files these files will become same as others and when i will try to delete them it will also delete other files in the directory with same extension. i only want to delete the files which have +SHR attribs , i dont want to delete normal files. after setting attribs of my files which i want to delete will become normal as others are, and then the delete function will delete all files included normal. anybody pleaz help me out!@! [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk"
weaponx Posted August 21, 2008 Posted August 21, 2008 You will have to use FileListToArray + FileGetAttrib to filter out files with these attributes.
zFrank Posted August 21, 2008 Author Posted August 21, 2008 can i have a simple but usefull example please...? [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk"
weaponx Posted August 21, 2008 Posted August 21, 2008 can i have a simple but usefull example please...?#Include <File.au3> $root = @ScriptDir $aFiles = _FileListToArray($root, "*.*",1) For $X = 1 to $aFiles[0] $attrib = FileGetAttrib ($root & "\" & $aFiles[$X]) If StringInStr($attrib, 'S') AND StringInStr($attrib, 'H') AND StringInStr($attrib, 'R') Then FileDelete($root & "\" & $aFiles[$X]) EndIf Next
zFrank Posted August 21, 2008 Author Posted August 21, 2008 #Include <File.au3> $root = @ScriptDir $aFiles = _FileListToArray($root, "*.*",1) For $X = 1 to $aFiles[0] $attrib = FileGetAttrib ($root & "\" & $aFiles[$X]) If StringInStr($attrib, 'S') AND StringInStr($attrib, 'H') AND StringInStr($attrib, 'R') Then FileDelete($root & "\" & $aFiles[$X]) EndIf Next Thanx a lot dear, it was really helpfullll keep the good work up! thanks again... [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk"
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