0

I have a .bat file that I am allowed to run on a Windows Server when connected via Remote Desktop. I am however not able to run that .bat file when connected via ssh client. I am using the same user/credentials for both connections.

The error message says:

coopr@WIN-3PI2FA523CJA89 C:\Users\Coopr\Server\Startup>StopCoopR.bat
ERROR: Access denied

The Script does the following:

@echo off
cd C:\Users\Coopr\Server\

taskkill /IM CoopR.exe /F

Might it be that taskkill has some special behaviour when it comes to remote access?

xetra11
  • 119
  • echo and cd are internal commands, but taskkill is not (meaning its a separate executable); perhaps you need to provide its full path? – aschipfl Aug 05 '19 at 15:31
  • the full path of taskkill? – xetra11 Aug 06 '19 at 14:03
  • Yes, usually it's at C:\Windows\System32\taskkill.exe; perhaps you can write %SystemRoot%\System32\taskkill.exe... – aschipfl Aug 06 '19 at 14:09
  • coopr@WIN-3PI2OSCJA89 C:\Users\Coopr\Server\Startup>%SystemRoot%\System32\taskki ll.exe /IM CoopR.exe /F ERROR: Access denied
    • still denied :(
    – xetra11 Aug 06 '19 at 14:11
  • 1
    Did you try runas command or psexec? – Elie Aug 08 '19 at 10:42
  • 1
    also refer to this question https://superuser.com/questions/181581/how-can-i-run-something-as-administrator-via-cygwins-ssh – Elie Aug 08 '19 at 11:07

0 Answers0