Page 1 of 1

Label Question

Posted: 28 May 2011 14:27
by Cleptography
What is going on here...?

Code: Select all

call :set

:set
echo.%~

Re: Label Question

Posted: 28 May 2011 15:04
by Ed Dyreen

Code: Select all

F:\SUB>call :set
Het volgende gebruik van de padoperator bij het vervangen
van batchparameters is ongeldig: %~


Typ CALL /? of FOR /? voor geldige gebruiksmogelijkheden.
De syntaxis van de opdracht is onjuist.
F:\SUB>echo.%~
F:\SUB>

That means you can't do that :P

google translate

Code: Select all

The following uses of padoperator when replacing
of batch parameters is invalid:% ~


Type CALL /? or FOR /? for valid uses.
The command syntax is incorrect.


you should use a batch, to test a batch : TST_noterm.CMD

Code: Select all

@echo off
start "CMD" /b "%COMSPEC%" /k "tst.CMD" parameter

Re: Label Question

Posted: 28 May 2011 15:20
by Cleptography
Thank you for the reply Ed, interesting my output is giving me

Code: Select all

:set
 was unexpected at this time.

If I change %~ to %! I get the error that you get.
This only happens if I use %~ everything else gives the error that you get.

Re: Label Question

Posted: 28 May 2011 15:42
by Ed Dyreen
I did it wrong I guess :? now I get the same error :)
but as the error suggest use call /? or for /? to learn about it, there is also plenty of topics on this.