Windows environment variable auto increment

1

Summarized question

I need an environment variable in windows that is auto increment:

  

setx / a PORT = 1000

and every time you call the% PORT%:

  

setx / a PORT =% PORT% + 1

The result would be:

echo %PORT%
1001
echo %PORT%
1002
echo %PORT%
1003

Which leads to the question,

Where to put the command?

  

setx / a PORT =% PORT% + 1

Question Explained

I'm trying to debug an applet in java on windows, other settings did not work, the only one that worked was

create an ambiante variable

JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=2502

But when doing this only 1 java application can be executed, when trying to run a second an error is thrown saying that the 2502 port is already in use.

My idea now is to do something like

JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=%PORT%

where %PORT% will be an increased number.

    
asked by anonymous 04.11.2015 / 13:25

0 answers