Retrieves information about a particular opening of a server resource
#include <NetShare.au3>
_Net_Share_FileGetInfo ( $sServer, $iFileID )
$sServer | Specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is blank, the local computer is used. |
$iFileID | File identifier of the resource for which to return information. The value of this parameter must have been returned in a previous enumeration call. |
Success: | an array with the following format: [0] - ID number assigned to the resource when it is opened [1] - Access permissions associated with the opening application: 1 - Permission to read a resource and execute the resource 2 - Permission to write to a resource. 4 - Permission to create a resource 8 - Execute permission 16 - Delete permission 32 - Change attribute permission 64 - Change ACL permission [2] - Contains the number of file locks on the resource [3] - Specifies the path of the opened resource [4] - Specifies which user or which computer opened the resource |
Failure: | sets the @error flag to non-zero. |
Administrator, Server or Print Operator or Power User group membership is required to execute this function.
_Net_Share_SessionGetInfo, _Net_Share_ShareGetInfo
Search NetFileGetInfo in MSDN Library.
#include "Extras\HelpFileInternals.au3"
#include <GUIConstantsEx.au3>
#include <NetShare.au3>
#include <WindowsStylesConstants.au3>
Example()
Func Example()
Local $sServer, $aFile, $aInfo
; Create GUI
GUICreate("NetShare", 400, 300)
; Create memo control
_MemoCreate(2, 2, 396, 296, $WS_VSCROLL)
GUISetState(@SW_SHOW)
; Get server and share information
$sServer = InputBox("NetWork Demo", "Enter Server Name:", "\\MyServer", "", 200, 130)
If @error Then Exit
; Enumerate open files on the server
$aFile = _Net_Share_FileEnum($sServer)
_MemoWrite("Error ...................: " & @error)
_MemoWrite("Entries read ............: " & $aFile[0][0])
_MemoWrite()
; Get information for each open file (same as $aFile info)
For $iI = 1 To $aFile[0][0]
$aInfo = _Net_Share_FileGetInfo($sServer, $aFile[$iI][0])
_MemoWrite("Error ...................: " & @error)
_MemoWrite("File permissions ........: " & _Net_Share_PermStr($aInfo[1]))
_MemoWrite("File locks ..............: " & $aInfo[2])
_MemoWrite("File path ...............: " & $aInfo[3])
_MemoWrite("File user ...............: " & $aInfo[4])
_MemoWrite()
Next
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>Example