Trying to run the bat located below on a remote computer but can't figure out how I'd use the psexec command to run it on the remote computer and if it would work correctly.
I have another bat file that I want to use with this. I would select a number such as 1 and after selecting 1 it would ask for the device name of the computer it would remote to and the username of the user. It would then remote into the computer kill the application, clear the files, and restart the application.
I can't figure out how I could use psexec properly to work this remotely. It does everything locally without issue.
@ECHO OFF
set /P inputusr=Enter Username:
set /P inputdevicename=Enter Computer ID:
tasklist /FI "IMAGENAME eq CiscoJabber.EXE"
taskkill /IM CiscoJabber.exe /T /F
timeout 5 >nul
taskkill /IM CiscoJabber.exe /T /F
timeout 3 >nul
tasklist /FI "IMAGENAME eq CiscoJabber.EXE"
timeout 3 >nul
::LOCAL FOLDER
Set DataDir=C:\Users\%inputusr%\AppData\Local\Cisco\Unified Communications
del /q /s /f "%DataDir%"
rd /s /q "DataDir%"
For /d %%x in (C:\Users\%inputusr%\AppData\Local\Cisco\Unified CommunicationsC:\Users\%inputusr%\AppData\Local\Cisco\Unified Communications\*) do del /q /s /f %%x\*sqlite
timeout 3 >nul
::ROAMING FOLDER
Set DataDir=C:\Users\%inputusr%\AppData\Roaming\Cisco\Unified Communications
del /q /s /f "%DataDir%"
rd /s /q "DataDir%"
For /d %%x in (C:\Users\%inputusr%\AppData\Local\Cisco\Unified CommunicationsC:\Users\%inputusr%\AppData\Roaming\Cisco\Unified Communications\*) do del /q /s /f %%x\*sqlite
timeout 3 >nul
ECHO.
ECHO Launching Cisco Jabber...
ECHO.
CD C:\Program Files (x86)\Cisco Systems\Cisco Jabber\
Start CiscoJabber.exe