3

My company has a ultra-low tech 'document sharing system': We have certain key Word documents that are stored on a shared drive on a Windows 10 PC and everyone can write to the document. They are told to ALWAYS close the DOC after they're done. It's -mostly- worked fine for us for 20 years. But... of course, someone occasionally leaves a DOC open and we have to run over to the person's machine to close it---which gets to be a pain. So I want to be able to shut down THEIR copy of Word, executing on THEIR remote machine, but while sitting at MY PC. In the old days of Unix, I would use 'kill' for this.

But since we're on Windows I have been trying to use PSKill to shut down the copy of Word executing on the remote PC, but I can't get it to work.

pskill \\4770K -u adminusername -p 124567890 "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE"

(Where 4770K is the name of the remote computer I am using as a test. I also tried using the IP of the remote machine I am using as a test. Neither worked.)

...it always comes back with

 "Cannot find the path"

What am I doing wrong?

OR, is there another way to shut down Word remotely? OR , is there another way to shut down a specific Word DOC remotely?

TWO UPDATES: 1. We are NOT using a domain. We are using a Windows Workgroup. Does this matter?

  1. When I have tried using TASKLIST just to see if I can connect.

    tasklist /S 4770k

...I am asked for the password on my LOCAL computer--not the remote computer (as I would expect.)

  1. I tried enabling the Remote Registry in Services. Didn't help anything.

  2. Using Windows 10. I'm wondering if this isn't a change in Win10?

UPDATE I've since tried the following:

TASKKILL /S 4770K /U adminusername /P 124567890 /F /IM "WINWORD.EXE"

Doesn't work. However, -again- this works fine from the console of that machine (4770K)

  • Are you on another computer when you typing the command? If you are, you need to specify the computer name with a \\computername If you are on the system that you want to kill the process on you can put your pskill.exe file in your windows directory so you have a path to it. Then just type. "pskill processname.exe" OR you can use the process ID and type "pskill PID" – Citizen May 31 '16 at 2:01
  • 1
    I am on another computer---that's the point. And please see my question. I -am- typing in the remote computer name (in this case '4770K'). I also tried using the IP of the remote machine (again as I wrote above) and that doesn't work either. I was hoping there was an obvious flaw in my command line syntax... OR that the command for MS Word was not 'WINWORD.EXE'. – jchwebdev May 31 '16 at 3:21
  • You know that for PSTools to work, you need to have "local account token filter policy" enabled in their registry on that specific computer. – Antp Jul 9 '16 at 0:24
1

have you tried this. Open regedit on the computers you want to be able to control, go to

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"

And make a new DWord, Call it LocalAccountTokenFilterPolicy Then press modify and change the value to 1, you should now be able to controll this computer with PSkill or any other PSTool program.

enter image description here

If you want a batch script file to automatically do this, Here it is

REG ADD HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Hope this helped. Antp

Ps, Your "update" in your post, should work using this method

| improve this answer | |
  • YOU DA MAN! Two quick questions: 1) Are there any security issues? ie. does this open us up to remote access from outside the LAN? 2) How did you find out about this? – jchwebdev Jul 9 '16 at 17:12
  • NB: Not directly related, but one possible caveat for -us- is that when you shut down WinWord, the program marks any open documents as 'recovered'. It's not a problem per se, but obviously, one should check to make sure any files that were open are not being damaged in some way. – jchwebdev Jul 9 '16 at 17:14
  • You can check here: support.microsoft.com/en-us/kb/951016 and see the part stating "How UAC remote restrictions work: To better protect those users who are members of the local Administrators group, we implement UAC restrictions on the network. This mechanism helps prevent against "loopback" attacks. This mechanism also helps prevent local malicious software from running remotely with administrative rights." – Pimp Juice IT Jul 9 '16 at 17:29
  • Well, I'm not sure if there are any security issues, I doubt there would be, Your second question, couple of years ago, I was looking to do the same thing, so I was researching and trying different things out, finally got it to work, then wrote that small script. Glad it works for you. :) – Antp Jul 13 '16 at 4:01
3

How can I close Microsoft Word on a remote Windows machine?

Is there another way to shut down Word remotely?

There is another way to do this on Windows operating systems, and it's with the TASKKILL command using the correct switches, security credentials, and so on.

EXAMPLES

Executing remote command with account that has access to perform the operation:

TASKKILL /S <RemoteComputer> /F /IM "<ProcessName.exe>"

Executing remote command with explicit security to perform the operation:

TASKKILL /S <RemoteComputer> /U <UserCredential> /P <UserPassword> /F /IM "<ProcessName.exe>"

Potential example you could use:

TASKKILL /S 4770K /U adminusername /P 124567890 /F /IM "WINWORD.EXE"

Enabling Group Policy Allow Remote Administration

Use the following steps in the Group Policy editor (Gpedit.msc) to enable "Allow Remote Administration" on the computer which you'll need to access remotely.

Essentially, this opens up TCP ports 135 and 445 for WMI and RCP traffic at the Windows OS Firewall level.

Under the Local Computer Policy heading, double-click Computer Configuration.

Double-click Administrative Templates, Network, Network Connections, and then Windows Firewall.

If the computer is in the domain, then double-click Domain Profile; otherwise, double-click Standard Profile.

Click Windows Firewall: Allow remote administration exception. On the Action menu, select Properties. Click Enable, and then click OK.

enter image description here


Further Resources

| improve this answer | |
  • Thanks. Keeps telling me "The user name or password is incorrect". I'm using the username and password for the remote machine AND the computer name as I see it in the Network section of Explorer. What am I doing wrong? – jchwebdev May 31 '16 at 5:32
  • No joy. I've even tried creating new dummy user accounts on the remote machines and every permutation of upper case, lower case I can think of. 4770k\uname, 4770K\uname. This has -got- to be something stupid simple, right? – jchwebdev May 31 '16 at 20:11
  • Updated my question. 1) Using a workgroup not a domain. 2) Tasklist not working either. – jchwebdev May 31 '16 at 20:20
  • Still no joy. It says 'User name or password is incorrect' HOWEVER, if I specify a bogus user name, it says "The specified account does not exist." Any other ideas? – jchwebdev Jun 1 '16 at 4:08
  • Still no luck. "The user name or password is incorrect". Taskkill seems to work fine on local machine but never on remote. – jchwebdev Jul 8 '16 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.