I have something similar to the following...
set /p dir=Specify Path:
if exist %dir% (
echo ok
) else(
echo not ok
)
If the user enters a path or variable like %userprofile%
when %dir% is used %userprofile% is not expanded within.
for example
set dir=%userprofile%
echo %dir% :: this does not expand
call echo %dir% :: this does expand
cd %dir% :: does not expand
call cd %dir% :: expands
but how would I have the path expand within a if statement.
Been banging my head on this one and i'm not really understanding DelayedExpansion.
Thanks.
Aucun commentaire:
Enregistrer un commentaire