Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要编写一个采用当前路径(%~dp0)的脚本,将反斜杠转换为正斜杠并将其进一步传递给某个命令。
由于环境的原因,我正在使用的唯一选项是 windows shell(不是 Powershell,问题不会成为问题)。
甚至有可能做到这一点吗?
该set命令具有替换功能:
set
set a=C:\test\dir set a=%a:\=/% echo %a%
结果是:
C:/test/dir