Automate an openvpn connection with task scheduler?

1,101 Views | 5 Replies | Last: 7 mo ago by AgySkeet06
AgySkeet06
How long do you want to ignore this user?
AG
Curious if anyone has setup an automated vpn connection using task scheduler?

I am working with a group to share/sync data. They set me up with their IT using an OPENVPN GUI that allows me to vpn into their closed network. The vpn works fine but the problem is i have manually connect by simply clicking on the connect button in the interface. I only need to connect for like 5 minutes every day to sync a data file.
The data collection/sync software is capable of being set on a schedule but i have to manually connect to the vpn.

It would be nice if i could find a way to automatically connect to the vpn such as through task scheduler. A lot of the videos and forums i have found reference windows 10 and when i try to replicate those processes i get an error so i assume something is slightly different for windows 11.

Thanks in advance for anyone that share how they did this or direct me to a resource i might not have found yet.
CapCity12thMan
How long do you want to ignore this user?
AG
If you can use open vpn from the command line wouldn't this work? I think it has a CLI: https://openvpn.net/connect-docs/command-line-functionality-windows.html
AgySkeet06
How long do you want to ignore this user?
AG
Thats a level of tech wizardry I'm not familiar with...
aggiez03
How long do you want to ignore this user?
AG
I think you might be able to run the program from taskscheduler or a batch script and then have another application click the CONNECT button based on button location.


Prompt: Program to run a program and click a button windows 11

AI Overview

It appears you're looking for ways to launch a program and then simulate a mouse click on a specific button within that program on Windows 11
.
Here are several approaches you can use, ranging from simple tools to more advanced scripting:
1. Using Macro Recording Tools:
  • Quick Macro (QMacro): A free tool to record, replay, and edit keyboard and mouse macros.
  • GS Auto Clicker: A free tool to automate clicks at specific screen locations or at the current mouse cursor position. You can set a keyboard shortcut to start/stop the auto-clicking process.
  • Auto Clicker - Automated Mouse Click (Microsoft Store): This application allows you to automate mouse clicks, choose click intervals, and set the number of clicks (finite or infinite).
  • Macro Recorder: This tool records mouse and keyboard actions for playback and can identify the click position based on the visual context rather than fixed coordinates, even if the target shifts.
  • Auto Clicker - Mouse clicker and Key presser (Microsoft Store): A tool for automating mouse clicks and key presses, designed to simplify repetitive tasks.
  • Expert Auto Clicker (Microsoft Store): An automation tool specifically for automating mouse clicks, compatible with Windows 11.
2. Scripting with AutoHotkey:
  • AutoHotkey is a powerful scripting language for Windows automation.
  • You can use AutoHotkey to create scripts that:
    • Launch the desired application.
    • Use the
      ControlClick
      function to send a click to a specific button within the application, regardless of whether the program is active or the button has moved.
    • Find the control's Name/ID using a window spy tool.
    • Target the button by its text (e.g., an "OK" button).
  • You can set up hotkeys to trigger these scripts.
  • You can also schedule AutoHotkey scripts to run automatically at startup by placing a shortcut in the Windows startup folder.
3. Using Built-in Windows Tools:
  • Task Scheduler: You can use Task Scheduler to schedule a task to run the desired program at a specific time or event (e.g., when the user logs in).
  • While Task Scheduler can launch programs, it doesn't have built-in capabilities to directly click buttons within the program's interface. You would need to combine it with a macro tool or a scripting solution like AutoHotkey.
4. Power Automate Desktop:
  • Power Automate Desktop allows you to record and replay repetitive actions, including mouse clicks, across multiple applications and websites.
  • You can use Power Automate Desktop to:
    • Record the process of opening the application and clicking the desired button.
    • Edit the recording with a visual interface and over 400 predefined actions.


https://www.autohotkey.com/
Koko Chingo
How long do you want to ignore this user?
AG
if task scheduler doesn't work there is a python package called 'appopener'. AppOpener is a Python library designed to open and close applications and you don't have to write about all the file paths, just use an abbreviated name.

ChatGPT or another AI should be able to walk you through the steps. It works really good.
AgySkeet06
How long do you want to ignore this user?
AG
You are the man! I ended up going with "Macro Recorder" and it does exactly what i need!
It had a scheduler feature built in that syncs with windows task scheduler.
I've enabled it to run the task at 7am daily so I'll have to wait until monday to see if it does it all on its own.
Refresh
Page 1 of 1
 
×
subscribe Verify your student status
See Subscription Benefits
Trial only available to users who have never subscribed or participated in a previous trial.