Bonjour,
j'utilise un TProcess pour supprimer un lecteur réseau avec Lazarus 2.08 FPC 3.04 x86_64-win64 sur un Windows 10 pro 64.
Le showmessage affiche
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 function unMountDrive : String; var aProcess: TProcess; aStringList: TStringList; begin aProcess := TProcess.Create(nil); aStringList := TStringList.Create; with aProcess do begin CommandLine := 'NET USE R: /DELETE'; Options := Options + [poWaitOnExit, poNoConsole, poUsePipes]; Execute; aStringList.LoadFromStream(AProcess.Output); result := aStringList.Text; aStringList.Free; Free; end; end; ShowMessage(unMountDrive);J'ai essayé de l'afficher correctement avec LazUtf8, LConvEncoding... sans succès.R; a?t? supprim?.
Merci pour votre aide. Cordialement. Gilles
Partager