Я просто хочу сделать что-то вроде этого
(defun my-fun (reg-path)
"reads the value from the given Windows registry path."
...??...
)
Есть ли встроенный FN, который делает это?
или в окна встроен инструмент командной строки, который я могу запустить для получения значения reg?
Мне кажется, что я запускаю файл .js в cscript.exe, который делает работу.
ОТВЕТ
(defun my-reg-read (regpath)
"read a path in the Windows registry. This probably works for string
values only. If the path does not exist, it returns nil. "
(let ((reg.exe (concat (getenv "windir") "\\system32\\reg.exe"))
tokens last-token)
(setq reg-value (shell-command-to-string (concat reg.exe " query " regpath))
tokens (split-string reg-value nil t)
last-token (nth (1- (length tokens)) tokens))
(and (not (string= last-token "value.")) last-token)))
==> Спасибо Олегу.