NetFileEnum would appear to enumerate file users, and the MSDN indicates
that it should work on a remote server using by passing that server's UNC
name.
http://www.msdn.microsoft.com/library/psdk/network/ntlmapi2_5dm5.htm
Paul Ritchie
Radio Computing Services.
> -----Original Message-----
> From: Nello Sestini [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 03, 2001 2:15 PM
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Who has this file open?
>
>
> you could do a
>
> NET FILE
>
> shell command and capture the output.
> there will be lines like this
>
> 41 Z:\audio\...od Morning Good Morning.mp3 administrator 0
>
>
> for each file - the leftmost number is the file ID and you
> can get details on each of them by doing another NET FILE command
>
> NET FILE 41
>
> which will give you stuff that looks like:
>
> D:\>net file 41
> File ID 41
> User name administrator
> Locks 0
> Path Z:\audio\Beatles\(11) Good Morning Good Morning.mp3
> Permissions R
> The command completed successfully.
>
>
> Very klunky I know, sorry.
>
> And - it has one serious problem that I think makes it useless
> in the situation you described - it only works on the local
> server. If you need this information on a remote server
> you need to get it executed over there somehow.
>
> The really irritating thing in all of this is that the old NT 3.5
> file manager "winfile" let you read this stuff right off a
> right-click properties dialog. Not only did MS remove it
> from the NT4 and later but they've hidden the API that does it.
>
> arrgh.
>
>
> -ns
>
>
> ----- Original Message -----
> From: "Mark Derricutt" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Thursday, May 03, 2001 8:39 AM
> Subject: [DUG]: Who has this file open?
>
>
> > Is there anyway to pragmatically find out which NT user has
> a file open?
> >
> > i.e. I want to copy a new version of an exe to the testing
> server, but its
> > in use, anyway to get a listing saying "user1", "user3"?
> >
> >
> >
> >
> --------------------------------------------------------------
> ------------
> -
> > New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> > Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> >
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"