zxc3 Posted August 20, 2005 Posted August 20, 2005 How to remove files from a folder, not knowing names of files contained in a folder if one of files is used by the unknown external program?Filedelete ("D:\folder1") command does not work...
Somerset Posted August 20, 2005 Posted August 20, 2005 Filedelete ("D:\folder1\*.*") you needed the wild card
Moderators SmOke_N Posted August 20, 2005 Moderators Posted August 20, 2005 There was a topic a couple of days ago on this:http://www.autoitscript.com/forum/index.php?showtopic=14813 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.
BigDod Posted August 20, 2005 Posted August 20, 2005 Filedelete ("D:\folder1\*.*") you needed the wild card<{POST_SNAPBACK}>FileDelete will not delete a file that is in use. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
zxc3 Posted August 20, 2005 Author Posted August 20, 2005 FileDelete will not delete a file that is in use.<{POST_SNAPBACK}>Commands Filedelete (" D:\foldrer1\*. * ") and Filedelete ("D:\foldrer1") work equally.But both of them do not work in my case - I have tried. Files do not delete in general.Thanks.
BigDod Posted August 20, 2005 Posted August 20, 2005 Below is a link to a utility that can tell what is locking a file that is in use.http://www.dr-hoiby.com/WhoLockMe/index.php Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
zxc3 Posted August 20, 2005 Author Posted August 20, 2005 Below is a link to a utility that can tell what is locking a file that is in use.http://www.dr-hoiby.com/WhoLockMe/index.php<{POST_SNAPBACK}>Why this program works$i=0FileChangeDir("d:\folder1")$search = FileFindFirstFile("*.*") ; Check if the search was successfulIf $search = -1 Then;MsgBox(0, "Error", "end") $I=1else $i=0 EndIf While $i<>1 $file = FileFindNextFile($search) if $file="" then exit $DEL=("D:\folder\") & ($file);MsgBox(0, "$del", $del,1) filedelete($del) If @error Then ExitLoop WEnd And it is simple filedelete (" D:\folder\*. *) does not work?
BigDod Posted August 20, 2005 Posted August 20, 2005 And it is simple filedelete (" D:\folder\*. *) does not work? (" D:\folder\*. *) should be (" D:\folder1\*. *") Assuming none of the files are in use it should work Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
zxc3 Posted August 21, 2005 Author Posted August 21, 2005 (" D:\folder\*. *) should be (" D:\folder1\*. *") Assuming none of the files are in use it should work<{POST_SNAPBACK}>Yes, thanks for specification, this command does not work, if though one file is borrowed with the external program.
BigDod Posted August 21, 2005 Posted August 21, 2005 Yes, thanks for specification, this command does not work, if though one file is borrowed with the external program.<{POST_SNAPBACK}>What external program ? Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
zxc3 Posted August 25, 2005 Author Posted August 25, 2005 What external program ?<{POST_SNAPBACK}>My problem - to remove a folder to which have access many users of a local area network.I.e. to disconnect from files of users, and then to erase a folder, but I am not confident, that during disconnect, someone will not try to be connected again, etc.
BigDod Posted August 25, 2005 Posted August 25, 2005 My problem - to remove a folder to which have access many users of a local area network.I.e. to disconnect from files of users, and then to erase a folder, but I am not confident, that during disconnect, someone will not try to be connected again, etc.<{POST_SNAPBACK}>You could always use FileSetAttrib to make the folder read only and then set it back afterwards. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
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