The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Windows 7 Task/Logoff Problem

    Discussion in 'Windows OS and Software' started by GLBL WMR, Jan 19, 2011.

  1. GLBL WMR

    GLBL WMR Notebook Enthusiast

    Reputations:
    0
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    15
    I use a VPN on my laptop. I have created a task to launch the VPN client and connect upon login and successful internet connection under any user. There are 2 users on the box - myself (administrator) and my gf (standard user).

    My problem is I need to find a way to close the program / kill the VPN process upon the locking of our user accounts (and closing of the lid). Problem being that if my gf starts the machine and logs in and closes the lid when she's done (effectively locking her user account), I can't connect with the VPN under my user account because the process is running under her and my subscription allows for one connection at a time. If I can kill the process upon a user locking, the scheduled task will start the VPN the next time either one of us logs in.

    "Logoff" is not an option under Power Management upon closing the lid - sleep and hibernate are not going to help me, and I don't want to shut it down every time the lid closes. Any ideas?
     
  2. w7pro

    w7pro Newbie

    Reputations:
    0
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    5
    I don't think there's a way to edit the power settings that way. My suggestion is to change your plan settings so that your display shuts down after "x" amount of time of inactivity. That might be the closest solution.

    -- Ryan
    Windows Outreach Team
     
  3. davidfor

    davidfor Notebook Consultant

    Reputations:
    65
    Messages:
    262
    Likes Received:
    0
    Trophy Points:
    30
    You might be able to do it with another scheduled task. Looking at the task creation, for the trigger, you can choose "On workstation lock". If you can close the VPN software using a command line, you could create a task to do this. Or the trigger could be an event such as going into standby.

    The other thought is why do you need to start the VPN software? If the gf was connected and you switch to your account, the connection should still be running and you should have access. In this case, you would need to prevent the VPN program from starting if it is already running and connected. Or does locking the account log her out of the VPN but not close the VPN program?
     
  4. GLBL WMR

    GLBL WMR Notebook Enthusiast

    Reputations:
    0
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    15
    Do you have examples of the specific command I could use for this task? I'm not familiar with Windows commands/scripts. In regards to why I have to start the VPN software, each user opens their own session - if it's running under my user and I have her switch user, it will need to run a new session but it wont let her because my connection is still live. Additionally, the other user doesn't have the ability to switch server locations or alter other configs in the client if it's running under another.
     
  5. davidfor

    davidfor Notebook Consultant

    Reputations:
    65
    Messages:
    262
    Likes Received:
    0
    Trophy Points:
    30
    I haven't done this on Windows for a while and had to look it up. So, have a read of How to kill hanged program from command line [ Windows ]
     
  6. Rune Hagen

    Rune Hagen Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    We solved this very issue at work, not VPN, but another service we needed.

    It's quite simple when you think about it.
    The scheduled task you start the VPN with needs to kill any prior running processes hogging the license.

    Write small batch file that first kills the VPN task, like this
    TASKKILL /T /F /IM vpnprogram.exe

    then starts it again using

    START "fullpath\vpnprogram.exe"

    The trigger could be:
    "On local connection to any user"
    "On workstation unlock of any user"
    "At log on of any user"

    Just a suggestion

    You could also make another batch file with just the first line to stop vpn from running.
    "On workstation lock of any user"
    "on local disconnect from any user session"

    That would kill it if one user let's the machine go idle or locks the desktop.
    If the user logs off the task should be killed anyway right?
     
  7. Rune Hagen

    Rune Hagen Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    and of course run the .bat files as scheduled tasks :D