Generate a unique id in my bat file

1

Hi, I made a small bat to start an application with a different log eg.

Applicacion -many -workdir "C:\Users\User\Desktop\instance3\data"

But what I wanted to do is that the instance3 value every time I start it is unique so each log will be different. It is possible to generate a unique id ex.

Applicacion -many -workdir "C:\Users\User\Desktop\"idunico"\data"

How can I carry out this task? or at least how to generate it in my bat so that every time I start it is different.

It can be numeric, letters or alpha numeric or combination of all but the id each time the bat starts should be different.

    
asked by Jesus Garcia 28.12.2017 в 16:15
source

1 answer

0

One option is to use % RANDOM% , to generate a random number between 0 and 32767 and you would use it this way:

Applicacion -many -workdir "C:\Users\User\Desktop\%RANDOM%\data"
    
answered by 28.12.2017 / 16:44
source