batch to kill a process (and also relaunch it then)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Sebastian42
Posts: 34
Joined: 17 Feb 2017 02:28

batch to kill a process (and also relaunch it then)

#1 Post by Sebastian42 » 17 Feb 2017 02:39

Sometimes the clipboard stops working. I'm led to believe that ending the clipboard process and then relaunching it, should solve the problem. I want to automate that in a batch file for 'easy access' at a moment's notice. https://technet.microsoft.com/en-au/lib ... 2147217396 gives examples of syntax (and explanations) for stopping processes, but I find it too complex to comprehend. None of my experimenting has produced a batch file that stops the clipboard from working. I have tried command lines like : "kill clip.exe"; "kill c:\windows\system32\clip.exe” and "taskkill /s srvmain /f /im rdpclip.exe", but none of them in a batch file seem to affect the clipboard functionality in Win10. Neither clip.exe nor rdpclip.exe show when 'tasklist' is typed into Command prompt. I'd like some help - preferably a finished batch file - to at least START the process (if not complete it).

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: batch to kill a process (and also relaunch it then)

#2 Post by Squashman » 17 Feb 2017 07:33

Sebastian42 wrote:Sometimes the clipboard stops working. I'm led to believe that ending the clipboard process and then relaunching it, should solve the problem.

What hypothesis led you to this belief?

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: batch to kill a process (and also relaunch it then)

#3 Post by ShadowThief » 17 Feb 2017 07:47

The clipboard isn't a process, it's a data buffer. You can't stop or start it.

Sebastian42
Posts: 34
Joined: 17 Feb 2017 02:28

Re: batch to kill a process (and also relaunch it then)

#4 Post by Sebastian42 » 17 Feb 2017 14:45

Squashman wrote:
Sebastian42 wrote:Sometimes the clipboard stops working. I'm led to believe that ending the clipboard process and then relaunching it, should solve the problem.

What hypothesis led you to this belief?

A google search - I did not document the source.

Sebastian42
Posts: 34
Joined: 17 Feb 2017 02:28

Re: batch to kill a process (and also relaunch it then)

#5 Post by Sebastian42 » 17 Feb 2017 14:53

Squashman wrote:
Sebastian42 wrote:Sometimes the clipboard stops working. I'm led to believe that ending the clipboard process and then relaunching it, should solve the problem.

What hypothesis led you to this belief?


From https://social.technet.microsoft.com/Fo ... progeneral
"The best solution I have found is to pull up task man, end the process rdpclip.exe, and then restart it by first changing focus from task manager to another program and back to task manager, choose file>new task (run) and then typing in rdpclip.exe and hit enter. The remote clip service will restart, and usually the copy you wanted to paste immediately becomes available."

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: batch to kill a process (and also relaunch it then)

#6 Post by ShadowThief » 18 Feb 2017 07:46

Sebastian42 wrote:
Squashman wrote:
Sebastian42 wrote:Sometimes the clipboard stops working. I'm led to believe that ending the clipboard process and then relaunching it, should solve the problem.

What hypothesis led you to this belief?


From https://social.technet.microsoft.com/Fo ... progeneral
"The best solution I have found is to pull up task man, end the process rdpclip.exe, and then restart it by first changing focus from task manager to another program and back to task manager, choose file>new task (run) and then typing in rdpclip.exe and hit enter. The remote clip service will restart, and usually the copy you wanted to paste immediately becomes available."

That's exclusively for when you experience the problem on a remote machine you're interacting with via RDP, unfortunately.

Post Reply