小编Ter*_*enz的帖子

批量路径与行情

如何检查路径是否有引号,如果没有则添加它?我知道我可以做类似的事情:

set /p path="My path "
"%path%"
Run Code Online (Sandbox Code Playgroud)

但我的报价有问题

C:\My folder --> "%path%" --> "C:\My folder" --> Good
Run Code Online (Sandbox Code Playgroud)

如果用户放置带引号的路径

"C:\My folder" --> "%path%" --> ""C:\My folder"" --> Wrong
Run Code Online (Sandbox Code Playgroud)

我不能使用双引号,因为我调用的外部命令行不起作用并给我错误.那么只有在路径中找不到时才能添加""?谢谢

batch-file

5
推荐指数
1
解决办法
2510
查看次数

标签 统计

batch-file ×1