Che*_*eso 4 windows registry emacs
我只是想做这样的事情
(defun my-fun (reg-path)
"reads the value from the given Windows registry path."
...??...
)
Run Code Online (Sandbox Code Playgroud)
是否有一个内置的fn这样做?
或者是否有一个内置于Windows的命令行工具,我可以运行以检索reg值?
我想象的方式是在cscript.exe中运行一个完成工作的.js文件.
(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)))
Run Code Online (Sandbox Code Playgroud)
==>谢谢Oleg.
| 归档时间: |
|
| 查看次数: |
270 次 |
| 最近记录: |