蝙蝠侠
@echo off
set url=D:\Download\Path with space inside
echo "%url%"
pause
输出:
C:\Users\Admin\Desktop>go
"D:\Download\Path with space inside"
Premere un tasto per continuare . . .
如果我像这样传递参数:
C:\Users\Admin\Desktop>go D:\Download\Path 里面有空格
@echo off
set url=%~1
echo "%url%"
pause
输出错误:路径不正确
C:\Users\Admin\Desktop>go D:\Download\Path with space inside
"D:\Download\Path"
请帮忙:D
答案1
使用此批处理文件
@echo off
set url=%~1
echo "%url%"
pause
您需要在“”中传递路径
C:\Users\Admin\Desktop>go "D:\Download\Path with space inside"
该命令及其输出将是:-
C:\Users\Admin\Desktop>go "D:\Download\Path with space inside"
"D:\Download\Path with space inside"
如果有效,请告诉我。