Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #178540

Re: Does Windows 11 have any tricks to make free VPN connections easier?

From Andrew <andrew@spam.net>
Newsgroups alt.comp.os.windows-10, alt.comp.os.windows-11, alt.comp.microsoft.windows, alt.msdos.batch
Subject Re: Does Windows 11 have any tricks to make free VPN connections easier?
Date 2024-08-24 19:58 +0000
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <vade08$1agk$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <vad0u7$i6a$1@nnrp.usenet.blueworldhosting.com> <1crujlj79yqkv.1hrumom41i8le$.dlg@40tude.net>

Cross-posted to 4 groups.

Show all headers | View raw


JJ wrote on Sun, 25 Aug 2024 00:45:19 +0700 :

> For the UAC prompt problem, you can use Task Scheduler to run the program 
> with highest privileges. Make sure the "Run with highest privileges" setting 
> of the scheduled task is enabled. The user account used to run the the task 
> doesn't have to be the built-in Administrator account, and instead, should 
> be your own user account.

Long story... on Task Scheduler... which many suggest... but none test. :)

Many times I have set up task-scheduled elevated permission actions to
avoid UAC using the task scheduler, e.g., editing the Win10 registry using:
 Win+R regopen [return]
 Which is a keyword of that same name (i.e., regopen.exe) found in
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\regopen.exe
 Which defaults to executing the similar shortcut C:\pathto\regopen.lnk
 Whose target is C:\Windows\System32\schtasks.exe /run /TN "task regopen"
 Where Win+R taskschd.msc will show that task in the Task Scheduler Library
 Where in "General" the checkbox is set to "Run with highest privileges"
 Where the "Actions" tab is set to "Start a program" (with no options)
 And where the program to run without UAC is "C:\Windows\regedit.exe"

All that works fine for many programs which are to be *individually*
started, but the problem here is I never got that working for openvpn.

So I gave up.

To be clear, I got it working for many other tasks, such as turning on and
off the Windows gateway (for isolation to prevent reconnecting at times).
 Win+R off [return]
 Which is a keyword of that same name (i.e., off.exe) found in
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\off.exe
 Which defaults to executing a default shortcut C:\pathto\off.lnk
 Whose target is C:\Windows\System32\schtasks.exe /run /TN "task off"
 Where Win+R taskschd.msc will show that task in the Task Scheduler Library
 Where in "General" the checkbox is set to "Run with highest privileges"
 Where the "Actions" tab is set to "Start a program" (with options)
 And where the program is set to "%comspec%" and where the arguments are
 "/c start "" %windir%\system32\route.exe delete 0.0.0.0 192.168.0.1"
 Which runs the command below whenever "off" is typed in the run box
 %comspec% /c start "" %windir%\system32\route.exe delete 0.0.0.0 192.168.0.1
 And where there's a similar "Win+R on" command to turn it back on
 %comspec% /c start "" %windir%\system32\route.exe add 0.0.0.0 mask 0.0.0.0 192.168.0.1

I could go on and on with a score of similarly set up task scheduler tasks.

But for the life of me, I have never been able to get the VPN related task
scheduled setup working to work around the UAC for openvpn's privileges.

 Win+R vpnopen [return]
 Which is a keyword of that same name (i.e., vpnopen.exe) found in
 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vpnopen.exe
 Which defaults to executing a default shortcut C:\pathto\vpnopen.lnk
 Whose target is C:\Windows\System32\schtasks.exe /run /TN "task vpnopen"
 Where Win+R taskschd.msc will show that task in the Task Scheduler Library
 Where in "General" the checkbox is set to "Run with highest privileges"
 Where the "Actions" tab is set to "Start a program" (with options)
 And where the program is set to the openvpn daemon C:\pathto\openvpn.exe
 And where arguments are set to any one particular VPN configuration file
 C:\pathto\vpngate_1.250.96.236_udp_1195.ovpn
 Which never worked so I changed it to program "%comspec%" and arguments
 /c start "" c:\pathto\openvpn.exe C:\pathto\vpngate_1.250.96.236_udp_1195.ovpn
 Which still never worked because it has to be done for thousands of files.

But I set up all those task failures long ago, where probably I should try
anew now that I have a better batch script which chooses the configs using
 set cmd=C:pathto\openvpn.exe
 set dir=C:\users\whoami\vpn\
 set file=vpngate_1.250.96.236_udp_1195.ovpn
 REM %cmd% %dir%%file%
 runas.exe /user:administrator /savecred "%cmd% %dir%%file%"

Knowing the setup for the task scheduler, do you have any suggestions 
for how to run the batch file such that the openvpn.exe GUI has elevated
privileges when it tries to change the routing table with route.exe?

> However, the problem is that, the VPN client program requires a different 
> user credential. Windows doesn't have any feature to securely automate 
> inputting it. So the credential must already been stored in a file - 
> preferrably under the user's profile folder and with the NTFS encryption 
> file attribute enabled, so that it won't be readable in plain text by other 
> than your Windows user account. That being said, any application which is 
> run using your user account, will be able to read the file.

I am confused by that paragraph as I really don't know this stuff well.
What I "think" you're saying is that "/savecred" is a bad idea.
I get that. I know that. I wish I had a better way around UAC. 
I really do.

But I tried the task scheduler in the past and failed miserably with
running any of thousands of openvpn config files with the openvpn.exe
daemon which itself has to modify the routing table with route.exe.

Note that I must have a score of commands that I've automated to ignore the
UAC prompt by using the task scheduler method (I only showed you two).

But I have never gotten the Windows task scheduler to work with openvpn.

Do you think it's even possible given openvpn.exe has to itself be able to
modify the route (which I presume it does by calling route.exe internally)?

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-24 16:15 +0000
  Re: Does Windows 11 have any tricks to make free VPN connections easier? Paul <nospam@needed.invalid> - 2024-08-24 13:27 -0400
    Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-24 19:07 +0000
      Re: Does Windows 11 have any tricks to make free VPN connections easier? Peter Johnson <peter@parksidewood.nospam> - 2024-08-25 10:40 +0100
        Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-25 22:17 +0000
          Re: Does Windows 11 have any tricks to make free VPN connections easier? wasbit <wasbit@nowhere.com> - 2024-08-26 09:25 +0100
            Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-27 05:59 +0000
        Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-25 22:32 +0000
      Re: Does Windows 11 have any tricks to make free VPN connections easier? Chris <ithinkiam@gmail.com> - 2024-08-25 10:59 +0000
        Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-25 23:12 +0000
      Re: Does Windows 11 have any tricks to make free VPN connections easier? Andy Burns <usenet@andyburns.uk> - 2024-08-28 20:13 +0100
  Re: Does Windows 11 have any tricks to make free VPN connections easier? JJ <jj4public@outlook.com> - 2024-08-25 00:45 +0700
    Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-24 19:58 +0000
      Re: Does Windows 11 have any tricks to make free VPN connections easier? JJ <jj4public@outlook.com> - 2024-08-25 16:56 +0700
        Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-25 21:37 +0000
          Re: Does Windows 11 have any tricks to make free VPN connections easier? JJ <jj4public@outlook.com> - 2024-08-26 12:59 +0700
            Re: Does Windows 11 have any tricks to make free VPN connections easier? Andrew <andrew@spam.net> - 2024-08-27 05:45 +0000
  Re: Does Windows 11 have any tricks to make free VPN connections easier? Graham J <nobody@nowhere.co.uk> - 2024-08-25 10:16 +0100
  Re: Does Windows 11 have any tricks to make free VPN connections easier? Brian Gregory <void-invalid-dead-dontuse@email.invalid> - 2024-08-28 21:26 +0100

csiph-web