Monday, 16 February 2009

Getting the rest of the params in a batch file

If you try this you will be sadly disappointed

set FIRST=%1
shift /1
set THEREST %*

The best way I have seen to do this is as follows :

for /f "tokens=1*" %%a in ("%*") do (   
    set FIRST=%%a   
    set THEREST=%%b)

No comments:

Post a Comment