Forum Discussion

JerryIrons's avatar
JerryIrons
Active Contributor
7 years ago

Hamachi not powering on after computer restart

Can you please provide the option to power on hamachi from a command line?  This is really becoming a problem, here is what happens:

workstation restarts, due to windows operating system update, environment power condition, etc, and once everything restarts, hamachi is in the "powered off" condition.    Then we are screwed, because there is no remote access, and now a human being has to make a physical trip to the workstation to click on "power on".

 

Please add this functionality, I am a long time hamachi user.  But this power off thing that is happening at random with windows 10 is really becoming an issue.

 

  • So, I've figured out a way to deal with this.  I wrote a windows service that monitors the logmein service and it's power on status.  If either get turned off my service restarts them.  So far has been working very well and ended the random shutdowns that can happen. 

  • ganeshowen's avatar
    ganeshowen
    Active Contributor

    Hi guys, 

    I created a batch file that turns on hamachi and enables a network on startup. To get it to run subtletly on startup I created a shortcut to the file and changed the properties so it starts minimized.

    Open notepad and paste in the following code.

     

    cd C:\Program Files (x86)\LogMeIn Hamachi\x64
    hamachi-2.exe --cli login
    hamachi-2.exe --cli go-online <network ID>

    NB:     1: The first line will vary depending on the location of your hamachi install

                 2: Replace the "<network ID>" with the numerical identifier displayed when you hover over your Network in the Hamachi client. 

     

    Save As and add ".cmd" to the file. Store it somehwere safe (I put it in the hamachi folder) and create a  shortcut.

    Open start menu, type "run" and press enter.

    Type "shell:startup" to open your startup folder and move the shortcut here. Finally right click on the shortcut, click properties and change the dropdown menu adjacent to "run" to Minimized.

    Hope this helps, I'm not a coder so aplogies if this doesn't work for you. I built this out of some very basic how to guides and some trial and error with the hamachi-2.exe in CMD.

    • beardbiz's avatar
      beardbiz
      New Contributor

      ganeshowen: 

       

      you wrote: 2: Replace the "<network ID>" with the numerical identifier displayed when you hover over your Network in the Hamachi client. 

       

      When I hover over over my network it just gives me the network name as the network ID. All letters, no numbers.

      • ganeshowen's avatar
        ganeshowen
        Active Contributor

        Hi,

        I've attached a screenshot of what I see when my mouse hovers over the network. Where the red-line is where I see a numerical Network ID (XXX-XXX-XXX) that I used in my simple batch file.

        Hope this helps.

  • JerryIrons's avatar
    JerryIrons
    Active Contributor

    So, I've figured out a way to deal with this.  I wrote a windows service that monitors the logmein service and it's power on status.  If either get turned off my service restarts them.  So far has been working very well and ended the random shutdowns that can happen. 

    • nuncidvides's avatar
      nuncidvides
      Active Contributor
      Hi Jerry. Can you share more details of how you wrote this Windows service to monitor the LogMeIn application's power status? I've been encountering the same issue. I am able to tell whether the Hamachi service is running, but have been unable to determine whether it's powered on via Windows.
      • nawcom's avatar
        nawcom
        New Member

        I can't speak for Jerry but an easy way to check the status of the Hamachi connection is 

        c:\Program Files (x86)\LogMeIn Hamachi\x64\hamachi-2.exe --cli list

        Exclude the full pathname if appropriate in your specific case, etc etc. If the VPN is currently off, this will be the result

        You have no networks.

        If the script picks that up as a response, have it run

        c:\Program Files (x86)\LogMeIn Hamachi\x64\hamachi-2.exe --cli logon

        And that's the equivalent of pressing the power button on the UI. That way whenever the Hamachi is disconnected for whatever reason, it will attempt to reconnect and log back on without the need of the UI.

         

        For some reason on a new computer that I installed Hamachi on, it seems to randomly decide not to auto-connect (aka "Power" on) and it would be offline, requiring me to press the power button on its UI. Other times it would auto-connect just fine. Apparently this is controlled via a config file some place but the fact that it isn't being consistent was something I found odd. So what I did was create a task run in Task Scheduler to execute that previous command (hamachi-2 --cli logon) set to run "At Startup", set it to run with Administrative privileges whether a user is logged in or not, and set a Condition for it to run after getting a Network Connection with the device that provides internet access. This way Hamachi is already connected to the VPN before anyone logs on (assuming the person doesn't log in fast enough to get ahead of it). From now on I won't have to deal with the randomness of it not auto-connecting or worry about its configuration set to do so.