J'ai 2 couches (ou peut-être plus dans le futur) de fichiers batch qui me facilitent la vie jusqu'au moment où j'ai essayé d'ajouter des chemins avec des espaces.Comment appeler un fichier batch à partir d'un autre fichier batch avec des paramètres contenant des espaces?
fichier Lot 1:
@echo off
set thinga=c:\final build
set thingb=\\server\deployment for final buil
echo.
echo thing a: %thinga%
echo thing b: %thingb%
echo.
call lala.bat "%thinga%" "%thingb%"
fichier batch 2 (lala.bat):
@echo off
echo.
echo. Param 1 %1
echo. Param 2 %2
echo.
set BASE=%1
set TARGET=%2
echo. Want to run:
echo. doSomethingOnBaseFolder %BASE%
echo. doSomethingOnBaseSubFolder "%BASE%\bin\release\*" "%TARGET%\"
echo.
La sortie de c'est:
doSomethingOnBaseSubFolder ""c:\final build"\bin\release\*" ""\\server\deployment for final buil"\"
Mais je veux la sortie être
doSomethingOnBaseSubFolder "c:\final build\bin\release\*" "\\server\deployment for final buil\"
N'y a-t-il aucun moyen d'échapper à l'espace d'une autre manière?
Cela a fonctionné avec set BASE =% ~ 1 Vous êtes mon héros. –