To send Enter key over remote computers in CMD

2

1

Below is my batchfile script that will launch an application in HOST & remote computers.

@echo off
setlocal enableextensions enabledelayedexpansion
for /f %%a in (C:\COST\PCList.txt) do (
SET IP =%%a
SET C=0
IF %%a equ 0.0.0.0 (
"D:\QCtool.exe"
) ELSE (
ping -n 1 %%a | find "TTL=" >NUL: && SET C=1
IF !C! equ 1 (
psexec \\%%a -i -d -s "D:\QCtool.exe"
) else (
ECHO REMOTE %%a IS NOT REACHABLE
)
)
)
)
  1. What it does is it look for the ip addresses that I have maintained and will open application in remote computers using the PClist.txt.
  2. I have maintained the dummy IP 0.0.0.0 in my PC list in order to auto launch the same application in my HOST PC.
  3. So when the batch file reads the 0.0.0.0 it will launch the application in my HOST PC.

The thing i need to do is to press enter key to my host and local computers using cmd batch file after opening the application. Is there is any such command to do so please explain it using my above batchfile script.

Dragonborn

Posted 2015-01-14T04:37:57.297

Reputation: 132

Answers

0

I have found different solution like removing the necessity to press enter keystroke. However it would be good if there is any possibility to do the request as I mentioned in my question.

Dragonborn

Posted 2015-01-14T04:37:57.297

Reputation: 132