HRESULT GetFolderPermissions(
[in] BSTR bstrFolder,
[out, retval] VARIANT *aPermissions);
We are using GSFTP V3.1.3.
I have written a little script to show what's happening:
Set objFTPServer = WScript.CreateObject("SFTPCOMInterface.CIServer")
'server credentials
strServer = ""
intPort = 1000
strUserName = ""
strPassword = ""
'connect to server
On Error Resume Next
objFTPServer.Connect strServer, intPort, strUserName, strPassword
If Err.Number <> 0 Then
WScript.Echo "Error connecting to '" & strServer & ":" & intPort & "' -- " & err.Description & " [" & CStr(err.Number) & "]"
WScript.Quit(255)
Else
WScript.Echo "Connected to " & strServer
End If
On Error GoTo 0
'get sites info
Set objSites = objFTPServer.Sites
Set objSite = objSites.Item(0)
'get folder permissions
arrPerms = objSite.GetFolderPermissions("/") 'get permissions from root folder
If IsArray(arrPerms) Then
For intItem = LBound(arrPerms) To UBound(arrPerms)
WScript.Echo(arrPerms(intItem)) '<-- the error occurs here (Type Mismatch)
Next
End If
'cleanup
objFTPServer.Close
Set objSite = Nothing
Set objSites = Nothing
Set objFTPServer = Nothing
When you run this script it throws an error in line 28: Type Mismatch: 'arrPerms'
How can these permissions be accessed?
Regards
Thomas