Hopefully something simple.....
In a batch file, I want CMD to prompt a user for the number of project names they want to enter:
Example:
Enter number of projects:
Next if the user entered 2 they should be prompted to enter in the study project numbers:
Example:
- Enter first project number: PROJ001
- Enter second project number:PROJ002
Finally after they enter in all their project numbers for however many projects, there should be one new variable that contains them all in the form of:
Example:
'PROJ001','PROJ002'
So if they only entered 1 then the final variable that I would need would be 'PROJ001' but if they entered 2 or 3 or 4 etc. then it would be 'PROJ001','PROJ002 etc.
How input is taken I will leave up to you, for me it would be easiest if just:
Example:
Enter projects numbers separated by a space:
The the code would string these all together.
I do see some replies to this looking to close this post.....Yes I call Windows Command line DOS
I have tried this myself but my knowledge is limited.
For example
I have
set /p proj1=Enter Project:
set /p proj2=Enter Project:
set /p proj3=Enter Project:
set newvar='%proj1%','%proj2%','%proj3%'
However this would require constant updates if users wanted to add more than 3, and also one like to collect the data would be better.
Hopefully this clarifies the issue a bit more.