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
)
)
)
)
- 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.
- 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.
- 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.