Jump to content

deleting files in a folder


 Share

Recommended Posts

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"
Link to comment
Share on other sites

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.

When the words fail... music speaks.

Link to comment
Share on other sites

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"
Link to comment
Share on other sites

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
Link to comment
Share on other sites

#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"
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...