我只想做這樣的事情我可以從elisp中讀取Windows註冊表嗎?怎麼樣?
(defun my-fun (reg-path)
"reads the value from the given Windows registry path."
...??...
)
有一個內置的FN做這個?
還是有一個命令行工具內置到窗口,我可以運行檢索reg值?
我想象的做法是在cscript.exe中運行.js文件來完成這項工作。
ANSWER
(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)))
==>謝謝奧列格。
ahhh,比編寫定製的Javascript邏輯更容易閱讀!謝謝。 – Cheeso
參見http://marmalade-repo.org/packages/w32-registry – Cheeso
我想你將無法從Emacs Win32訪問64位節點。 – antonio