简体   繁体   中英

Process %1 to registry in batch script

I need to add this value %~dp0scss-formatter.bat %1 ( %~dp0 is folder path) and that part %1 should saved to this value too (not as file name, but string). My whole .bat file looks like this:

@echo off
reg add "HKEY_CLASSES_ROOT\scss_auto_file\shell\SCSS Format\command" /ve /t REG_SZ /d "%~dp0scss-formatter.bat %1" /f

It works well, except that %1 . In default value I need that %1 , so, is here any way how to do it? I mean, in registry that key will have default value, for example: D:\\Applications\\scss-formatter.bat %1 .

I found it. Instead of %1 use %%1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM