Board logo

标题: [注册表类] 如何让批处理获取到的路径斜杠\输出为竖杠| [打印本页]

作者: z542143604    时间: 2022-5-31 12:48     标题: 如何让批处理获取到的路径斜杠\输出为竖杠|

@Echo Off
Title Reg Converter v1.2 & Color 1A
cd %systemroot%\system32
call :IsAdmin

Reg.exe add "HKLM\SOFTWARE\Classes\Installer\Assemblies\E:|Program Files|Mastercam 2022|Mastercam|5axmsurfclr.dll" /v "5axmsurfclr,Version=\"2012.127.3881.0\",Culture=\"neutral\",FileVersion=\"2012.127.3881.0\",ProcessorArchitecture=\"Amd64\"" /t REG_MULTI_SZ /d "c~9mrW^ty=R@i6P'LIz,Root_Files>*wiB4heNt8d~gA6TMhV$" /f
Exit

:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
Cls & Echo You must have administrator rights to continue ...
Pause & Exit
)
Cls
goto:eof


这个变更为  把获取到的路径E:\Program Files\Mastercam 2022\   变成E:|Program Files|Mastercam 2022|
作者: Batcher    时间: 2022-5-31 14:54

回复 1# z542143604
  1. @echo off
  2. set "OldStr=E:\Program Files\Mastercam 2022\"
  3. set "NewStr=%OldStr:\=|%"
  4. echo,"%NewStr%"
  5. pause
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2