Label Question

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Label Question

#1 Post by Cleptography » 28 May 2011 14:27

What is going on here...?

Code: Select all

call :set

:set
echo.%~

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Label Question

#2 Post by Ed Dyreen » 28 May 2011 15:04

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
Last edited by Ed Dyreen on 28 May 2011 15:31, edited 1 time in total.

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: Label Question

#3 Post by Cleptography » 28 May 2011 15:20

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.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Label Question

#4 Post by Ed Dyreen » 28 May 2011 15:42

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.

Post Reply