Executer les commandes consoles sur le serveur
- Code : Tout sélectionner
Public Function ExecuteCommandeServeur_API(Byval wServer As String, Byval wCommande As String) As Long
' Execute les commandes consoles sur le serveur
%REM
Declare Function NSFRemoteConsole Lib "nnotes.dll" (Byval ServerName As String, Byval ConsoleCommand As String, rethBuffer As Long) As Long
Declare Function OSLockObject Lib "nnotes.dll" ( Byval lHandle As Long ) As Long
Declare Function OSUnlockObject Lib "nnotes.dll" ( Byval lHandle As Long ) As Integer
Declare Function OSMemFree Lib "nnotes" (Byval Handle As Long) As Integer
%END REM
'Déclaraton Variable
Dim nbBuf As Long
Dim pBuf As String
On Error Goto ErreurExecuteCommandeServeur_API
ExecuteCommandeServeur_API = NSFRemoteConsole(wServer, wCommande, nbBuf)
pBuf = OSLockObject(nbBuf)
Call OSUnlockObject(nbBuf)
Call OSMemFree(nbBuf)
pBuf = ""
Exit Function
ErreurExecuteCommandeServeur_API:
Msgbox "("+Cstr(Getthreadinfo (1))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
Exit Function
End Function