Jump to content

Filedelete


zxc3
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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=0

FileChangeDir("d:\folder1")

$search = FileFindFirstFile("*.*") ; Check if the search was successful

If $search = -1 Then

;MsgBox(0, "Error", "end")

$I=1

else

$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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

:whistle::dance::dance:


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

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...