I need to simulate user input in some sentences using cmd (command prompt) in windows 7+, I´ve searched here and found a good partial solution:
[PARTIAL SOLUTION] how to userinput without typing to a batch file
It works in most cases, but for some reason, fails in others. It works well, for example, with:
cmd /c echo y^> "%temp%\answer.tmp" ^& (chkdsk C: /F /R /X ^< "%temp%\answer.tmp") ^& del "%temp%\answer.tmp"
It creates a file named "answer.tmp" with two lines, one with the response ("y" in this case) and then pases it to"chkdsk C: /F /R /X" command and last, deletes it.
But, for some reason, it fails with this:
cmd /c echo y^> "%temp%\answer.tmp" ^& (dism /online /disable-feature /featurename:"TabletPCOC" ^< "%temp%\answer.tmp") ^& del "%temp%\answer.tmp"
The only thing changed is the command executed, this time "dism /online /disable-feature /featurename:'TabletPCOC'".
Do you have any Ideas?