将当前文件夹添加到 reg 文件 [英] Add current folder to reg file
本文介绍了将当前文件夹添加到 reg 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下 reg 文件
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Run script]
@="Run &script"
[HKEY_CLASSES_ROOT\*\shell\Run script\command]
@="\"C:\\Users\\teodora\\Desktop\\test.bat\" \"%1\""
如何添加当前文件夹的路径而不是使用 C:\Users... ?我知道如何在 .bat 文件中执行此操作,但对于 .reg 文件的工作方式不同.
How can I add the path of the current folder instead of using C:\Users... ? I know how to do this in a .bat file but for a .reg one doesn't work in the same way.
推荐答案
使用变量 %W
是工作目录.
Use the variable %W
which is the working directory.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Run script]
@="Run &script"
[HKEY_CURRENT_USER\Software\Classes\*\shell\run script\command]
@="cmd /c \"\"%W\\test.bat\" \"%1\"\""
使用 %W
而不是文字绝对路径似乎需要 cmd/c
作为前缀才能为我工作.
Using %W
instead of a literal absolute path seems to require cmd /c
as a prefix to work for me.
这篇关于将当前文件夹添加到 reg 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文