I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands.
For example, I'd like to accept a process ID from the user, and then run jstack against that ID, putting the results of the jstack call into a file. However, when I try this, it doesn't work.
Here's my sample bat file contents:
@echo off
set /p id=Enter ID:
echo %id%
jstack > jstack.txt
and here's what shows up in jstack.txt:
Enter ID: Terminate batch job (Y/N)?
question from:
https://stackoverflow.com/questions/66050140/how-can-i-make-a-bat-file-with-an-input-box 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…