Need to run a .exe on a network shared PC from a .bat file

August 27, 2012 at 19:08:11
Specs: Windows XP
I have created a .bat file that kills a .exe over a network share, but I need that .exe to be started again. I normally use a remote access program but that takes too long so I would like to some what automate it. Any ideas on how to start a .exe on a networked PC?

@echo off

echo.
set /p ip=What is the IP Address of the machine?
echo.
echo Removing Existing Net Share...
net use x:
net use x: /delete
echo.
echo Setting Net Share...
net use x: \\%ip%\c /user:testuser test
echo.

taskkill.exe /S %ip% /U testuser /P test /IM XXXXXX.exe

pause


See More: Need to run a .exe on a network shared PC from a .bat file

Report •

#1
September 4, 2012 at 07:40:59
This one has been on here a while so I went to google

perhaps investigating the sc command?

sc \\machine start <service>

some more information may be here as well
http://ss64.com/nt/sc.html

:: mike


Report •

#2
September 4, 2012 at 07:49:14
SC only works with services, and you can't kill a service. Well, you can, but by default Windows just restarts it. Psexec is probably the right answer, but it depends on the executable.

How To Ask Questions The Smart Way


Report •

#3
September 4, 2012 at 12:22:16
sorry, i thought it was usable for a start, I misread, thanks Razor2.3.

:: mike


Report •
Related Solutions


Ask Question