Search code examples
serviceremote-accessrestartreliabilityteamviewer

Reliable access to locked remote computer


What I have: I have Windows 7 on my home PC.

What I'm trying to do: I'm trying to keep TeamViewer running at home so I can always get to my home computer. The other day it got completely messed up and would not let me connect but everything else on the PC was just fine.

Items I've looked at:

I looked at this thread and it does not seem to apply to what I need:

Is it possible to start Teamviewer, to accept connections, from commandline?

... but it does not appear to be what I'm looking for.

I have looked at this:

https://serverfault.com/questions/48600/how-can-i-automatically-restart-a-windows-service-if-it-crashes

... and to test the script at the above URL, I stopped a service on my computer and pointed the above vbs script to that service and the vbs script will not restart that service, so that's not working.

What's happening:

From time to time on my home computer, TeamViewer hangs or gets messed up in some way and I cannot connect to my home computer. The last time this happened, the TeamViewer UI was still running but there was a little red dot next to the tray icon and the id numbers and password were blank in the UI so I had to right click and kill it and restart the computer and all was OK.

What I'd like to do:

Is there a way I can run some kind of script or something that will completely kill all TeamViewer processes and services and restart it completely? I'd like to schedule this type of activity once an hour so I can be assured of pretty much always being able to get into my home computer or else just wait an hour and it should be back up and available?

I have 20 years in IT with networking background, databases, GUI development, website development, hardware and software installation but no experience in brain surgery. I've given it a good try but am now asking for some help.

Thanks.


Solution

  • I think that task scheduler, taskkill and batch script is your friend here. create a batch file to stop any current team viewer process and then restart it. crate a batch file something like:

    taskkill /IM TeamViewer.exe 
    start "" "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
    

    (substitute the path to TeamViewer.exe on your own machine). Then create an hourly scheduled task to run the script using the highest privileges (using Windows Task Scheduler).

    Lookup taskkill for more info on killing tasks from the command line.

    Just to add that you'll have to have the PC in a associated in your teamviewer account in a group (e.g. My Computers) and use the same account to connect - otherwise the password change on restart will prevent you connecting (you won't know the new password).