i have script takes user input details using 'set /p' runs through series of commands.
when running script shortcut, works fine, when running directly command prompt, 'abc123 not recognised internal or external command', 'abc123' user input each of 'set /p' commands.
if press enter again @ point, move onto next 'set /p' never stores value.
i can't figure out what's wrong here!
here's scenario possibly reproducing problem sufficiently , giving hints resolve either "quoting" or via enabledelayedexpansion
==>30122435.bat ==>set "passw=xyz|abc123" ==>echo quoted percent "xyz|abc123" quoted percent "xyz|abc123" ==>setlocal enabledelayedexpansion ==>echo unquoted exclam. !passw! unquoted exclam. xyz|abc123 ==>echo unquoted percent xyz | abc123 'abc123' not recognized internal or external command, operable program or batch file. ==>type 30122435.bat @echo on set "passw=xyz|abc123" echo quoted percent "%passw%" setlocal enabledelayedexpansion echo unquoted exclam. !passw! echo unquoted percent %passw% ==>
Comments
Post a Comment