Давно встретился с тем,что Фар не умеет работать с Локальными дисками при работе через RDP.
Если есть какие-то идеи у сообщество буду рад услушить. Про \\tsclient\... знаем, но хотим что-бы из коробки.
I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it. (c) I Am Devloper I know nothing except the fact of my ignorance. (с) Socrates
DrKnS wrote:\\tsclient и есть изкоробки, изкоробочнее не бывает.
Имеется ввиду по Alt+F1 и Alt+F2
I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it. (c) I Am Devloper I know nothing except the fact of my ignorance. (с) Socrates
local TsClientId = "4B787BF1-4846-4FC9-9D63-A1D5E2D60FF8"
local F = far.Flags
MenuItem {
description = "TSCLIENT";
menu = "Disks";
guid = TsClientId;
text = "TSCLIENT";
action = function(openfrom,item)
local h = io.popen(win.GetEnv("SystemRoot").."\\system32\\net.exe use")
local s = h:read()
local tsdisks = {}
while s do
s = win.OemToUtf8(s):match("\\\\TSCLIENT\\%S+")
if s then
tsdisks[#tsdisks+1] = {disk=s,text=s:gsub("(\\\\TSCLIENT\\)(.)","%1&%2")}
end
s = h:read()
end
h:close()
if #tsdisks > 0 then
local res,pos = far.Menu(
{
X = openfrom==F.OPEN_LEFTDISKMENU and 10 or (APanel.Left and APanel.Width+10 or PPanel.Width+10),
Title="TS Disks", Bottom="", Id=win.Uuid(TsClientId),
MaxHeight=Far.Height-10,
},
tsdisks
)
if pos then
local ap = (openfrom==F.OPEN_LEFTDISKMENU and APanel.Left or openfrom==F.OPEN_RIGHTDISKMENU and not APanel.Left) and 1 or 0
panel.SetPanelDirectory(nil,ap,tsdisks[pos].disk)
end
end
end;
}
Last edited by HaRT on Fri 08 Sep, 2023 23:32, edited 1 time in total.
Reason:Починено форматирование кода
Задался вопросом, а как получить список дисков не через net use. Весь поиск приводит к WNetOpenEnum, WNetEnumResource
Но вот такое приводит к ошибке 487 "Попытка обращения к неверному адресу".
Есть вопрос, а возможно это встроить в сам фар а не макросом.
I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it. (c) I Am Devloper I know nothing except the fact of my ignorance. (с) Socrates