|
Answer» Please, 1) How to send bat session to log file, for review? 2) How do I keep 'CMD line PROMPT window' open. Usually as soon as *.bat is done the command window closes. 3) How can *.bat prompt user for input? Thanks! ...VernonI'm going to answer #3 because it's pretty simple!
Set /p variable=
That will prompt a use to enter a variable, say they enter Bob.
Then you can do this.
Echo %variable%
And it will say Bob. If they enter Cheese, then it will say Cheese.
Understand?I will add to that. You can put anything where he put variable and %variable%, You should always put quotes AROUND "%variables%" incase the user puts something in that has spaces.Problem 2.
I answer this with a question, do you want to start the command prompt as if you type CMD in the run bar, or do you want to keep you batch file open?
Add all the codes to the END of your script. For the first option:
Code: [SELECT]start cmd For the latter option, there are 2 sub-options.
a. Keep it open untill the user presses a button: Code: [Select]pause b. Keep it open for a certain amount of time: Code: [Select]ping localhost -n %seconds% -w 1000 > nulReplace %seconds% with however long in seconds you want.
There, I hope these solve your problem.
|