Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

That does not compute.


computers / alt.comp.os.windows-10 / Why Windows 10 batch admin isn't the same as its GUI admin?

SubjectAuthor
* Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
+* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Ralph Fox
|+* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Paul
||+* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
|||`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Andy Burns
||| +* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
||| |`- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Andy Burns
||| `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
||`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Ralph Fox
|| `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
|`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
| +* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Andy Burns
| |`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
| | `* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
| |  `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Andy Burns
| `* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Herbert Kleebauer
|  +* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Andy Burns
|  |`- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Ralph Fox
|  +- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
|  `* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Zaidy036
|   +* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Ralph Fox
|   |`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Paul
|   | `* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Ralph Fox
|   |  `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Paul
|   `* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
|    `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
+* Re: Why Windows 10 batch admin isn't the same as its GUI admin?JJ
|`- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal
`* Re: Why Windows 10 batch admin isn't the same as its GUI admin?Brian Gregory
 `- Re: Why Windows 10 batch admin isn't the same as its GUI admin?Scott Lurndal

Pages:12
Why Windows 10 batch admin isn't the same as its GUI admin?

<she5mh$17nl$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55228&group=alt.comp.os.windows-10#55228

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!axchmTDYVsEcI97kMu0dvw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Fri, 10 Sep 2021 02:34:43 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <she5mh$17nl$1@gioia.aioe.org>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="40693"; posting-host="axchmTDYVsEcI97kMu0dvw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Thu, 9 Sep 2021 23:34 UTC

Why doesn't right clicking on the batch command to select "run as admin"
work, when running the batch command in an admin window works just fine?

===== ===== ===== ===== =====
Tutorial: How to use freeopenvpn daily on Windows
(Please add improvements, e.g., how to wget the password would be nice.)

1. I assume you've already installed any decent free openvpn client.
This is the one I'd use (but I don't use their GUI).
https://openvpn.net/community-downloads/

For example, this is the most common 64-bit openvpn.exe client:
https://swupdate.openvpn.org/community/releases/OpenVPN-2.5.3-I601-amd64.msi

2. Then download any free openvpn configuration file off the net.
You can get these free configuration files from many locations.

This is just one example that is simple & easy to explain.
https://www.freeopenvpn.org/

For example, this file changes infrequently during the year.
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn

Save this file to wherever you want to store your VPN configs.
.\USA_freeopenvpn_udp.ovpn

3. Create a freeopenvpn.txt text file for the login & daily password.
notepad.exe freeopenvpn.txt

In that file put the current login & password, each on a line.
freeopenvpn
173975185

4. Modify the downloaded config file to call that text file.
notepad.exe USA_freeopenvpn_udp.ovpn

Change this line from: auth-user-pass
Change that line to: auth-user-pass freeopenvpn.txt

5. Create a batch command to run VPN for you as administrator.
notepad.exe freeopenvpn.bat

In that file add one line to call the desired config file.
c:\path-to\openvpn\bin\openvpn.exe USA_freeopenvpn_udp.ovpn

(Please use the full path to where you installed the executable.)

6. Now you can run VPN at any time by rightclicking on the batch file

I usually run it from the command line inside an admin window:
Win+R > cmd{ctrl+shft+rtn}
C:\> .\freeopenvpn.bat

But you should be able to run it as admin via the Windows File Explorer.
{Rightclick on freeopenvpn.bat}{Select "Run as admin"}

Note that you must run openvpn.exe as admin on Windows 10.
Otherwise it won't be able to successfully modify the routing table.

You can check the routing table before and after running the command:
route print | more

7. Doublecheck that you are on VPN if you're not sure you're connected.
Win+R > cmd{Enter}
C:\> curl icanhazip.com

That should return whatever IP address you're connected as.

8. Each day you want to use VPN, check for the new password:
https://www.freeopenvpn.org/

a. Modify the password line, as needed, of the freeopenvpn.txt file.
b. Then rightclick on the batch file to get on VPN
c. Press "F4" in the resulting command window when you wish to exit.

In summary, to get on VPN, you just run the batch file as admin, and to get
off VPN, you just press F4 in the resulting command window.

Each day you have to get the latest password off the web site.
But you only need to enter that password into the text file.

Everything else stays the same day to day.

Let me know if you have ideas for improvement (e.g., to wget the password
file daily, automatically would be nice and to graphically run the batch
command as admin would also be nice).

Note: This is being sent using _that_ exact method above.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55243&group=alt.comp.os.windows-10#55243

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx06.iad.POSTED!not-for-mail
From: -rf-nz-@-.invalid (Ralph Fox)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Message-ID: <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com>
References: <she5mh$17nl$1@gioia.aioe.org>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Face: 5gSW~"1=jGDo(BXfTrgL2BnC3tUB_\d0u@mP~wA1fvK`z8I[>1jXVVZ!N6ittQ.K<5!i3l> ==jcyAk.[B>kLg8TY{+8%edZ(le:ncPt%s8Pr?]QXNXO]0RC#V_zt|%>=bt>rZ2iCI^-yl7Be(]Ep> OfyI!3Bf|e
Lines: 27
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Fri, 10 Sep 2021 19:08:17 +1200
X-Received-Bytes: 1953
 by: Ralph Fox - Fri, 10 Sep 2021 07:08 UTC

On Fri, 10 Sep 2021 02:34:43 +0300, Scott Lurndal wrote:

> Why doesn't right clicking on the batch command to select "run as admin"
> work, when running the batch command in an admin window works just fine?

It works here. Windows 10 version 21H1.

1. I log in to a non-Administrator account.
2. I right-click on a batch file and choose "Run as Administrator".
3. At the UAC prompt, I enter the password for the Administrator
account.
3. A command prompt window appears.
4. If the batch file contains the command WHOAMI then the command
prompt window displays the name of the Administrator account,
not the name of my non-Administrator account which I ran it from.
5. Task Manager 'details' tab shows the user for both conhost.exe
and cmd.exe as being the Administrator account, not my
non-Administrator account which I ran it from.

What it is that leads you to believe it is not working for you?

--
Kind regards
Ralph

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shf5vl$f1m$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55244&group=alt.comp.os.windows-10#55244

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Fri, 10 Sep 2021 04:45:41 -0400
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <shf5vl$f1m$1@dont-email.me>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 10 Sep 2021 08:45:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e259c0ecaebe171ba9f3718a458b6a9b";
logging-data="15414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k+gS0p6Cb2jLG0/w3GoKILd4FCWLg96I="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:V38QhhkU/8mVErGl1YYA9NWxyng=
In-Reply-To: <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com>
 by: Paul - Fri, 10 Sep 2021 08:45 UTC

Ralph Fox wrote:
> On Fri, 10 Sep 2021 02:34:43 +0300, Scott Lurndal wrote:
>
>> Why doesn't right clicking on the batch command to select "run as admin"
>> work, when running the batch command in an admin window works just fine?
>
>
> It works here. Windows 10 version 21H1.
>
> 1. I log in to a non-Administrator account.
> 2. I right-click on a batch file and choose "Run as Administrator".
> 3. At the UAC prompt, I enter the password for the Administrator
> account.
> 3. A command prompt window appears.
> 4. If the batch file contains the command WHOAMI then the command
> prompt window displays the name of the Administrator account,
> not the name of my non-Administrator account which I ran it from.
> 5. Task Manager 'details' tab shows the user for both conhost.exe
> and cmd.exe as being the Administrator account, not my
> non-Administrator account which I ran it from.
>
>
> What it is that leads you to believe it is not working for you?

An example of a command and .bat file might be

whoami /user /priv
pause

This will show differences between an elevated attempt and
one which is not elevated.

User accounts can belong to the administrator group.

The first account created in a new Windows installation
belongs to the administrator group, so that the user
does not lose elevation capability and will have the
privileges necessary to "edit accounts".

User accounts don't have to belong to the administrator group.
An administrator can create such a restricted account to "keep
that user in the box". An account which does not belong to
administrator, might be useless for program installation,
as an example of why you might keep the user in that box.

The "SeImpersonate" privilege is a useful one, as an example
of a privilege you might want.

The third account case would be account "administrator", and
unless someone has been fooling around with the privilege set,
could well have exactly the same /priv info. Turning it on
would be one step, fiddling the privileges would be a
separate step. If you turn this on, the very next command
is setting a separate password for it.

net user administrator /active:yes # Not essential for normal ops!
net user administrator /active:no # New Win install, starts like this

Picture of an accounts dialog, with annotations.

https://i.postimg.cc/nrM0qdfR/accounts-dialog.gif

By executing /active:no after this picture was
taken, the administrator tile disappeared again.
And I am back to my "green" account doing the
administrator work on the box. If I deleted the
"green" account at that point in time, I would
be in trouble (as no other account has administrator
group privileges).

This is from a previous posting. It shows some examples
of the privileges list. (Select "Download original" to
get a less-fuzzy picture.) The session on the left is
a result of logging in as "administrator" then trying
a command prompt window. Whereas the center one is
logging in as the "normal" user who belongs to the
administrator group, and opening an administrator
command prompt (which elevates using the admin group
membership).

https://s18.postimg.cc/wowci9o95/whoami_user_priv.png

For a sample.bat testing of "Run as administrator", try:

whoami /user /priv
pause

for evidence you are elevated. The "long" list of privileges
would be the result of Running As Administrator.

Paul

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<dz3eju52ebrf.1cag93k8suvd5.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55245&group=alt.comp.os.windows-10#55245

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Followup: alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!vnFkJsW8ZghRIXI5HXnFBw.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Followup-To: alt.msdos.batch
Date: Fri, 10 Sep 2021 16:47:41 +0700
Organization: Aioe.org NNTP Server
Message-ID: <dz3eju52ebrf.1cag93k8suvd5.dlg@40tude.net>
References: <she5mh$17nl$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="3134"; posting-host="vnFkJsW8ZghRIXI5HXnFBw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Notice: Filtered by postfilter v. 0.9.2
 by: JJ - Fri, 10 Sep 2021 09:47 UTC

On Fri, 10 Sep 2021 02:34:43 +0300, Scott Lurndal wrote:
> Why doesn't right clicking on the batch command to select "run as admin"
> work, when running the batch command in an admin window works just fine?
[snip]

Define "doesn't work".

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shgiah$k25$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55254&group=alt.comp.os.windows-10#55254

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!axchmTDYVsEcI97kMu0dvw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 00:22:28 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shgiah$k25$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <dz3eju52ebrf.1cag93k8suvd5.dlg@40tude.net>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="20549"; posting-host="axchmTDYVsEcI97kMu0dvw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-newsreader: xrn 9.03-beta-14-64bit
X-Notice: Filtered by postfilter v. 0.9.2
 by: Scott Lurndal - Fri, 10 Sep 2021 21:22 UTC

JJ writes:
> Define "doesn't work".

1. If I run the one-line batch command in an admin window, it works.
2. If I rightclick run as admin in a file explorer window, it fails.

I'm pretty sure it's user error in terms of the batch file syntax.
There's something I'm not understanding about how Windows works.

Everything is run from the openvpn config file directory.
Everything is being run logged in as a user (with admin privileges).

The batch freeopenvpn.bat file contains only a single line.
c:\path-to\openvpn\bin\openvpn.exe freeopenvpn.ovpn

The freeopenvpn.conf config file itself calls the login/password file.
auth-user-pass freeopenvpn.txt

The freeopenvpn.txt login/password file contains only two lines.
freeopenvpn
055254372

Where that second line, the password, changes daily at the web site.
https://www.freeopenvpn.org/index.php

And where today that 9-digit password happens to be "055254372"
https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en

My simple method is these simple efficient steps.
1. I manually find the daily password (wget would be nice though)
2. In the File Explorer I doubleclick to add it to freeopenvpn.txt
3. I open an admin window & run the one line freeopenvpn.bat file

This is successful by all measures of how anyone would test VPN.
a. "curl icanhazip.com" reports the VPN connection
b. "route print|more" reports the VPN connection
c. And the command window reports a successful VPN connection

What I'd like to work is to be able to "run as admin" in the file explorer.
3. I right-click on freeopenvpn.bat & select "Run as administrator"

That flashes & then fails by all measures of how anyone would test VPN.
a. "curl icanhazip.com" reports the original (not the VPN connection)
b. "route print|more" reports the original (not the VPN connection)
c. And there is no window that reports anything after it flashes instantly

I don't know why "Run as administrator" doesn't work but it's perhaps
because I don't understand how Windows 10 batch commands work.

Is there a line or two I can add to the batch command to make it work?
--
BTW, I'm using that VPN connection as we speak so I know it works normally.
It just doesn't work inside the Windows File Explorer for an unknown reason.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shgjd7$1206$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55255&group=alt.comp.os.windows-10#55255

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!axchmTDYVsEcI97kMu0dvw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 00:40:57 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shgjd7$1206$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="34822"; posting-host="axchmTDYVsEcI97kMu0dvw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-newsreader: xrn 9.03-beta-14-64bit
X-Notice: Filtered by postfilter v. 0.9.2
 by: Scott Lurndal - Fri, 10 Sep 2021 21:40 UTC

Ralph Fox writes:
> What it is that leads you to believe it is not working for you?

By every measure of a VPN connection, the rightclick method fails.
a. It successfully connects to VPN when I run the command in an admin window
b. It fails to connect to VPN when I rightclick "run as administrator"

Exact same one line batch file command is being run in both cases above.
freeopenvpn.bat
c:\path-to\openvpn\bin\openvpn.exe freeopenvpn.ovpn

> It works here. Windows 10 version 21H1.

It fails on my version but I think I just need batch file syntax help.
C:\> ver
Microsoft Windows [Version 10.0.19042.1165]

a. When it works, I type "freeopenvpn.bat" & [Enter] in an admin window.
b. When it fails, I rightclick "freeopenvpn.bat" & run-as-administrator.

> 1. I log in to a non-Administrator account.
> 2. I right-click on a batch file and choose "Run as Administrator".

The one-line batch file I right-click on is named "freeopenvpn.bat"
It simply runs the desired command (which works in a cut and paste also).

> 3. At the UAC prompt, I enter the password for the Administrator
> account.

For whatever reason, at my UAC prompt, I don't have to enter a password.

> 3. A command prompt window appears.

For whatever reason, my "command prompt" is instantaneous.
It disappears in a nanosecond so I can't tell what it's doing inside.

> 4. If the batch file contains the command WHOAMI then the command
> prompt window displays the name of the Administrator account,
> not the name of my non-Administrator account which I ran it from.
> 5. Task Manager 'details' tab shows the user for both conhost.exe
> and cmd.exe as being the Administrator account, not my
> non-Administrator account which I ran it from.

In the admin window, running the command is successful as measured by
a. "curl icanhazip.com" reports the VPN connection
b. "route print|more" reports the VPN connection
c. And the command window reports a successful VPN connection

What I'd like to work is to be able to "run as admin" in the file explorer.
3. I right-click on freeopenvpn.bat & select "Run as administrator"

That flashes & then fails by all measures of how anyone would test VPN.
a. "curl icanhazip.com" reports the original (not the VPN connection)
b. "route print|more" reports the original (not the VPN connection)
c. And there is no window that reports anything after it flashes instantly

I don't know why "Run as administrator" doesn't work but it's perhaps
because I don't understand how Windows 10 batch commands work.

Is there a line or two I can add to the batch command to make it work?
--
BTW, I'm using that VPN connection as we speak so I know it works normally.
It just doesn't work inside the Windows File Explorer for an unknown reason.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<iq35rqFgj9dU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55265&group=alt.comp.os.windows-10#55265

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 08:57:46 +0100
Lines: 6
Message-ID: <iq35rqFgj9dU2@mid.individual.net>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net UmW/K+sPG9mCuMJhPVVwTgOOR+FFVLqEg5Up0v3to3N9N1ObQE
Cancel-Lock: sha1:4kiyiC4pbBAIu9Mvu8nCjwZ/G9E=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-GB
In-Reply-To: <shgjd7$1206$1@gioia.aioe.org>
 by: Andy Burns - Sat, 11 Sep 2021 07:57 UTC

Scott Lurndal wrote:

> For whatever reason, at my UAC prompt, I don't have to enter a password.

That means the user you are logged in as is an admin, generally you're
safer using a non-admin account day-to-day

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shhp6u$1gpo$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55266&group=alt.comp.os.windows-10#55266

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!BETDiKbE7LymTbPkhJKcwA.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 11:26:08 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shhp6u$1gpo$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <iq35rqFgj9dU2@mid.individual.net>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="49976"; posting-host="BETDiKbE7LymTbPkhJKcwA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Sat, 11 Sep 2021 08:26 UTC

Andy Burns writes:
>> For whatever reason, at my UAC prompt, I don't have to enter a password.
>
> That means the user you are logged in as is an admin, generally you're
> safer using a non-admin account day-to-day

Thanks for explaining why I didn't have to log in as admin at the UAC box.
I think the problem is only that I need to add "something" to the bat file.
But what?

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shhplb$1mfu$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55267&group=alt.comp.os.windows-10#55267

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!BETDiKbE7LymTbPkhJKcwA.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 11:33:50 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shhplb$1mfu$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <iq35rqFgj9dU2@mid.individual.net> <shhp6u$1gpo$1@gioia.aioe.org>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="55806"; posting-host="BETDiKbE7LymTbPkhJKcwA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Sat, 11 Sep 2021 08:33 UTC

Scott Lurndal writes:
>>> For whatever reason, at my UAC prompt, I don't have to enter a password.
>>
>> That means the user you are logged in as is an admin, generally you're
>> safer using a non-admin account day-to-day
>
> Thanks for explaining why I didn't have to log in as admin at the UAC box.
> I think the problem is only that I need to add "something" to the bat file.
> But what?

Actually, on second thought, there must be something in between:
a. A "real" admin
b. A user with admin privileges
c. The user

I base that on the fact that if I type the command in a user cmd prompt:
c:\path-to\openvpn\bin\openvpn.exe vpnconfigfile.conf
it will fail (if I run it as the user) to set the routing table properly.

However, if I type the exact same command in an admin window, it will work.

Hence, the user (even with admin privileges) must still be only midway
toward being a "real" admin given the user (even with admin privileges)
can't successfully run the necessary route commands to get onto VPN.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<iq38j6Fh5giU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55268&group=alt.comp.os.windows-10#55268

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 09:44:21 +0100
Lines: 38
Message-ID: <iq38j6Fh5giU1@mid.individual.net>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org>
<iq35rqFgj9dU2@mid.individual.net> <shhp6u$1gpo$1@gioia.aioe.org>
<shhplb$1mfu$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net aEbWJeHQDcDrJY8cpOyr9gZchF/P2XjXEUYH+mYFRKcVKj1iIA
Cancel-Lock: sha1:8FE0EuoVHdcdMqDQMsY6TO5u7Wc=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-GB
In-Reply-To: <shhplb$1mfu$1@gioia.aioe.org>
 by: Andy Burns - Sat, 11 Sep 2021 08:44 UTC

Scott Lurndal wrote:

> on second thought, there must be something in between:
> a. A "real" admin
> b. A user with admin privileges
> c. The user

Yes, being a member of the admin group dos not automatically mean you
are *using* all your admin rights

if you are logged in as your admin user, open a CMD window
then open another CMD window "as administrator"

look at the title of each CMD window

try out some harmless commands within each of them, e.g.

whoami /priv

arp -d *

route add

> I base that on the fact that if I type the command in a user cmd prompt:
> c:\path-to\openvpn\bin\openvpn.exe vpnconfigfile.conf
> it will fail (if I run it as the user) to set the routing table properly.

I can't remember if openvpn calls the network APIs, or if it spawns to
the route.exe or netsh.exe commands

> However, if I type the exact same command in an admin window, it will work.
>
> Hence, the user (even with admin privileges) must still be only midway
> toward being a "real" admin given the user (even with admin privileges)
> can't successfully run the necessary route commands to get onto VPN.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shhrcb$cgu$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55269&group=alt.comp.os.windows-10#55269

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!ABnqoHGBsk6V+NPGgBDVLw.user.46.165.242.91.POSTED!not-for-mail
From: klee@unibwm.de (Herbert Kleebauer)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 11:03:06 +0200
Organization: Aioe.org NNTP Server
Message-ID: <shhrcb$cgu$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="12830"; posting-host="ABnqoHGBsk6V+NPGgBDVLw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Herbert Kleebauer - Sat, 11 Sep 2021 09:03 UTC

On 10.09.2021 23:40, Scott Lurndal wrote:

> Exact same one line batch file command is being run in both cases above.
> freeopenvpn.bat
> c:\path-to\openvpn\bin\openvpn.exe freeopenvpn.ovpn

> a. When it works, I type "freeopenvpn.bat" & [Enter] in an admin window.
> b. When it fails, I rightclick "freeopenvpn.bat" & run-as-administrator.

> For whatever reason, my "command prompt" is instantaneous.
> It disappears in a nanosecond so I can't tell what it's doing inside.

Then insert a "pause" command at the end of the batch file so the
window stays open.

And don't forget, when you run the batch by a right click, there is a
different working directory as when run in a command window. Insert
a cd command at the beginning of the batch to have the same working
directory as with you command window.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<iq39rmFh5giU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55270&group=alt.comp.os.windows-10#55270

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 10:05:57 +0100
Lines: 11
Message-ID: <iq39rmFh5giU2@mid.individual.net>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org>
<shhrcb$cgu$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net K/ErfSNM5qqNkKgU+CQ59gWyJGTETKc+fcbNlirkCUyjMq3JLK
Cancel-Lock: sha1:nenesNdjwaTpr8E/morS7FZ3F/Y=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-GB
In-Reply-To: <shhrcb$cgu$1@gioia.aioe.org>
 by: Andy Burns - Sat, 11 Sep 2021 09:05 UTC

Herbert Kleebauer wrote:

> Scott Lurndal wrote:
>
>> For whatever reason, my "command prompt" is instantaneous.
>> It disappears in a nanosecond so I can't tell what it's doing inside.
>
> Then insert a "pause" command at the end of the batch file so the
> window stays open.

or REM out any EXIT command in the batch file

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shhs99$ogs$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55271&group=alt.comp.os.windows-10#55271

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!sPS6J0T5fWNt94nTn8BWOQ.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 12:18:36 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shhs99$ogs$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="25116"; posting-host="sPS6J0T5fWNt94nTn8BWOQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-newsreader: xrn 9.03-beta-14-64bit
X-Notice: Filtered by postfilter v. 0.9.2
 by: Scott Lurndal - Sat, 11 Sep 2021 09:18 UTC

Partial success!
I figured out WHERE the problem lies (but not WHAT the problem is).

A. For whatever reason, this configuration file won't "run as admin"
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn
B. But, for whatever reason, this configuration file does "run as admin"
https://vanwa.tech/download-free-openvpn-config

That means there's likely nothing wrong with Windows after all.
The problem is (somewhere) inside the VPN configuration file.

But where?

I ran a test changing _only_ the VPN service configuration file.

That test worked in both cases (which means it's the config file!).
A. When I run the one-line batch command in an admin window, it works.
B. When I rightclick run as admin in a file explorer window, it works.

Here is how I successfully ran that test just moments ago.
1. I went to VanWa to pick up a different free openvpn config file
https://vanwa.tech/free-openvpn-service

2. I downloaded that free VPN config as "VanwaTech-Free-OpenVPN.ovpn"
https://vanwa.tech/download-free-openvpn-config

3. I created a vanwa.bat file containing the one line
C:\path-to\openvpn\bin\openvpn.exe VanwaTech-Free-OpenVPN.ovpn

This bat file connected to VPN using every method but one (which is ok).
a. It connected to VPN when I ran the bat file in an admin window
b. It connected to VPN when I pasted the command into an admin window
c. It connected to VPN when I rightclicked the bat file & "run as admin"
d. It failed to connect to VPN when I ran the bat command in a user window

That last failure is to be expected since the route commands require admin.

When I tested the results, the curl worked for all but (d) above.
C:\> curl icanhazip.com
(This outputs the VPN server connection IP address.)

This success with a different config file indicates Windows 10 is fine.
The problem is seemingly in how the VPN configuration files are configured.

A. For whatever reason, a one-line batch file containing the config file
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn
In this simple one-line command in that batch file
C:\path-to\openvpn\bin\openvpn.exe USA_freeopenvpn_udp.ovpn
won't work in the File Explorer when I rightclick "Run as Administrator"

B. But for whatever reason, a one-line batch file containing the config file
https://vanwa.tech/download-free-openvpn-config
In this simple one-line command in that batch file
C:\path-to\openvpn\bin\openvpn.exe VanwaTech-Free-OpenVPN.ovpn
does work in the File Explorer when I rightclick "Run as Administrator"

This indicates the problem isn't Windows 10 after all.
This indicates the problem is (somehow) in how a VPN config file is written.

Does anyone here know VPN well enough to tell us why that's the case?

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<iq3b2eFhkdgU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55272&group=alt.comp.os.windows-10#55272

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 10:26:37 +0100
Lines: 14
Message-ID: <iq3b2eFhkdgU1@mid.individual.net>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me>
<shhs99$ogs$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net mNyOjU7JIWujy8jicPrhrAu6kvaSaA+HuUrvB6BPjObGlZLP7V
Cancel-Lock: sha1:AruWT7yfcFhJWgi7MVPet6sgQFQ=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-GB
In-Reply-To: <shhs99$ogs$1@gioia.aioe.org>
 by: Andy Burns - Sat, 11 Sep 2021 09:26 UTC

Scott Lurndal wrote:

> Partial success!
>
> A. For whatever reason, this configuration file won't "run as admin"
> https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn
> B. But, for whatever reason, this configuration file does "run as admin"
> https://vanwa.tech/download-free-openvpn-config

I'm surprised windows follows the .ovpn file association to even do that

I'd "run as admin" a .cmd batch file that calls openvpn.exe with the
..ovpn file as a parameter?

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shhuna$1p5o$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55273&group=alt.comp.os.windows-10#55273

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!axchmTDYVsEcI97kMu0dvw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 13:00:13 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shhuna$1p5o$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="58552"; posting-host="axchmTDYVsEcI97kMu0dvw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-newsreader: xrn 9.03-beta-14-64bit
X-Notice: Filtered by postfilter v. 0.9.2
 by: Scott Lurndal - Sat, 11 Sep 2021 10:00 UTC

Herbert Kleebauer writes:
> And don't forget, when you run the batch by a right click, there is a
> different working directory as when run in a command window. Insert
> a cd command at the beginning of the batch to have the same working
> directory as with you command window.

SUCCESS AT LAST!
THE FULL PATH AT ALL TIMES (for the Windows FE) WAS THE PROBLEM!

a. When I ran in the command window, I didn't need to "cd"
b. But when I ran in the Windows File Explorer, I needed to "cd"
c. (or, in either case, I should have specified the full path in the ovpn).

Thank you for helping me solve the problem by identifying the error!

The full path was the problem, which was resolved in two completely
different ways (both of which worked just now in my tests!).
1. I could add the "cd" to the batch file, or,
2. I could add the full path to the login/password file in the ovpn file!

Either way worked!

A. Adding the "cd" to the batch file worked!
freeopenvpn.bat
cd C:\full-path-to\configs\
c:\path-to\openvpn.exe C:\full-path-to\configs\freeopenvpn.ovpn

B. But adding the full path to the login/password file also worked!
freeopenvpn.ovpn
auth-user-pass C:\\full-path-to\\configs\\freeopenvpn.txt

Who knew that the full path to the freeopenvpn.txt login/password file was
the problem all along? I only found that out when I added the pause to the
batch file, where that pause allowed me to finally see the error.

> Then insert a "pause" command at the end of the batch file so the
> window stays open.

Exactly as you suggested, the "pause" command helped point out the problem!

When I appended the "pause" command to the "freeopenvpn.bat" batch file:
c:\path-to\openvpn\bin\openvpn.exe C:\path-to\freeopenvpn.ovpn
pause
Which contained the openvpn config file from here:
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn
The results were
a. When run in the admin command window, VPN connected fine.
And, in fact, the pause never ran until AFTER I disconnected with F4.
b. But when I rightclicked the bat file to "Run as administrator",
After I hit "OK" to the UAC prompt, the error showed in the cmd window
Options error: --auth-user-pass fails with 'freeopenvpn.txt':
No such file or directory (errno=2)
c. I immediately realized from that error that I needed to change this
auth-user-pass freeopenvpn.txt
to this inside the freeopenvpn configuration file!
auth-user-pass C:\\full-path-to\\configs\\freeopenvpn.txt

As you had suggested, the problem was that the Windows File Explorer
needed me to "cd" to that directory, so that test you suggested also worked!

The reason that the _other_ VPN configuration file worked is simply that it
didn't make use of a login/password file (so it bypassed this "cd" problem).
https://vanwa.tech/download-free-openvpn-config

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<a6upjgtvdjle1kihi47jv4bcq2vpeattkd@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55285&group=alt.comp.os.windows-10#55285

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
From: -rf-nz-@-.invalid (Ralph Fox)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Message-ID: <a6upjgtvdjle1kihi47jv4bcq2vpeattkd@4ax.com>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Face: 5gSW~"1=jGDo(BXfTrgL2BnC3tUB_\d0u@mP~wA1fvK`z8I[>1jXVVZ!N6ittQ.K<5!i3l> ==jcyAk.[B>kLg8TY{+8%edZ(le:ncPt%s8Pr?]QXNXO]0RC#V_zt|%>=bt>rZ2iCI^-yl7Be(]Ep> OfyI!3Bf|e
Lines: 49
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sun, 12 Sep 2021 06:58:10 +1200
X-Received-Bytes: 2754
 by: Ralph Fox - Sat, 11 Sep 2021 18:58 UTC

On Fri, 10 Sep 2021 04:45:41 -0400, Paul wrote:

> Ralph Fox wrote:
>> On Fri, 10 Sep 2021 02:34:43 +0300, Scott Lurndal wrote:
>>
>>> Why doesn't right clicking on the batch command to select "run as admin"
>>> work, when running the batch command in an admin window works just fine?
>>
>>
>> It works here. Windows 10 version 21H1.
>>
>> 1. I log in to a non-Administrator account.
>> 2. I right-click on a batch file and choose "Run as Administrator".
>> 3. At the UAC prompt, I enter the password for the Administrator
>> account.
>> 3. A command prompt window appears.
>> 4. If the batch file contains the command WHOAMI then the command
>> prompt window displays the name of the Administrator account,
>> not the name of my non-Administrator account which I ran it from.
>> 5. Task Manager 'details' tab shows the user for both conhost.exe
>> and cmd.exe as being the Administrator account, not my
>> non-Administrator account which I ran it from.
>>
>>
>> What it is that leads you to believe it is not working for you?
>
> An example of a command and .bat file might be
>
> whoami /user /priv
> pause
>
> This will show differences between an elevated attempt and
> one which is not elevated.

That confirms it is elevated when I right-click on a batch file
and choose "Run as Administrator". The same as when I run the batch
command in an 'Administrator' Command Prompt window.

I also confirmed it is elevated by having the batch run a command
('openfiles') which requires elevation, and checking %ERRORLEVEL%.

So the OP's problem does not look to be related to elevation.

--
Kind regards
Ralph

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shiur9$1gui$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55286&group=alt.comp.os.windows-10#55286

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!byfYGra9UYTu3eUW2DIdpA.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 22:08:27 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shiur9$1gui$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me> <shhs99$ogs$1@gioia.aioe.org> <iq3b2eFhkdgU1@mid.individual.net>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="50130"; posting-host="byfYGra9UYTu3eUW2DIdpA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Sat, 11 Sep 2021 19:08 UTC

Andy Burns writes:
> I'd "run as admin" a .cmd batch file that calls openvpn.exe with the
> .ovpn file as a parameter?

While setting up the file association of *.ovpn to run the OpenVPN GUI is
likely what most people do, I can't doubleclick on the ovpn file because
that would run it as the user, who doesn't have the necessary permissions to
change the routing table. (Somehow, the OpenVPN GUI gets around that Windows
10 restriction, which didn't exist in Windows 7, by the way, AFAIR.)

But now, thanks to Herbert Kleebauer, the problem is forever resolved.

What I didn't realize was that the command window assumes different paths
than does the Windows File Explorer. Once Herbert Kleebauer explained the
Windows File Explorer works differently from the command line, the pieces
fell into place almost instantly thereafter...

1. In an administrator command window, I paste these commands to start VPN
REM freeopenvpn.bat
cd C:\pathto\configs\
c:\pathto\openvpn\bin\openvpn.exe C:\pathto\configs\freeopenvpn.ovpn

2. Or, in an administrator window, I run _that_ set as a single batch file
C:\pathto\configs\freeopenvpn.bat

3. Or, in the Windows File Explorer, I right click to run as administrator
{Rightclick on freeopenvpn.bat}{Run as administrator}

> I'm surprised windows follows the .ovpn file association to even do that

I think most people who install the openvpn GUI use its GUI to get on VPN.
https://openvpn.net/community-downloads/

But the only thing I use in the openvpn package is the client itself.
https://swupdate.openvpn.org/community/releases/OpenVPN-2.5.3-I601-amd64.msi

I believe the Windows OpenVPN GUI has some magic to get around the fact the
Windows 10 routing table has to be managed as administrator (but I don't use
the OpenVPN GUI so I don't know how it tricks Windows into thinking its an
admin when it's being run as the user).

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<0bvpjghghgqck2c81tvbi5jatqqmtisjk6@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55287&group=alt.comp.os.windows-10#55287

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
From: -rf-nz-@-.invalid (Ralph Fox)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Message-ID: <0bvpjghghgqck2c81tvbi5jatqqmtisjk6@4ax.com>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org> <iq39rmFh5giU2@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Face: 5gSW~"1=jGDo(BXfTrgL2BnC3tUB_\d0u@mP~wA1fvK`z8I[>1jXVVZ!N6ittQ.K<5!i3l> ==jcyAk.[B>kLg8TY{+8%edZ(le:ncPt%s8Pr?]QXNXO]0RC#V_zt|%>=bt>rZ2iCI^-yl7Be(]Ep> OfyI!3Bf|e
Lines: 33
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sun, 12 Sep 2021 07:15:01 +1200
X-Received-Bytes: 2067
 by: Ralph Fox - Sat, 11 Sep 2021 19:15 UTC

On Sat, 11 Sep 2021 10:05:57 +0100, Andy Burns wrote:

> Herbert Kleebauer wrote:
>
>> Scott Lurndal wrote:
>>
>>> For whatever reason, my "command prompt" is instantaneous.
>>> It disappears in a nanosecond so I can't tell what it's doing inside.
>>
>> Then insert a "pause" command at the end of the batch file so the
>> window stays open.
>
> or REM out any EXIT command in the batch file

On a normal Windows system when I right-click a batch file and
run-as-administrator, the Command Prompt window closes when execution
reaches the end of the batch file. Even when there is no EXIT command,
or when any EXIT command has been REM'd out.

If the Command Prompt window does not close for you in the same
scenario, then perhaps you have modified your own Windows Registry
association to change the command line from this:
cmd.exe /C "%1" %*
to this:
cmd.exe /K "%1" %*

--
Kind regards
Ralph
🦊

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<iq4dj3Fo2hbU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55288&group=alt.comp.os.windows-10#55288

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 20:15:46 +0100
Lines: 11
Message-ID: <iq4dj3Fo2hbU1@mid.individual.net>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me>
<shhs99$ogs$1@gioia.aioe.org> <iq3b2eFhkdgU1@mid.individual.net>
<shiur9$1gui$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 0BoxNSgb8Bc0ZjxLa1Ug2AKkosza/VQ604Bnq7I4gh3136B3S6
Cancel-Lock: sha1:XHIrjMMSoCgCp7iLB/dKDZcy2QA=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.1.0
Content-Language: en-GB
In-Reply-To: <shiur9$1gui$1@gioia.aioe.org>
 by: Andy Burns - Sat, 11 Sep 2021 19:15 UTC

Scott Lurndal wrote:

> I believe the Windows OpenVPN GUI has some magic to get around the fact the
> Windows 10 routing table has to be managed as administrator (but I don't use
> the OpenVPN GUI so I don't know how it tricks Windows into thinking its an
> admin when it's being run as the user).

It's been a while since I used openVPN, and I used to mainly use the
GUI, the trick to running it automatically "as admin" involved running
it as a triggered task scheduler job, based on the "user logged in" event.

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shj1rc$nn7$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55296&group=alt.comp.os.windows-10#55296

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!8Oo056xdGXzpzvA7wB7XHw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 22:59:42 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shj1rc$nn7$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shf5vl$f1m$1@dont-email.me> <a6upjgtvdjle1kihi47jv4bcq2vpeattkd@4ax.com>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="24295"; posting-host="8Oo056xdGXzpzvA7wB7XHw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Sat, 11 Sep 2021 19:59 UTC

Ralph Fox writes:
> On Fri, 10 Sep 2021 04:45:41 -0400, Paul wrote:
>
>> Ralph Fox wrote:
>>> On Fri, 10 Sep 2021 02:34:43 +0300, Scott Lurndal wrote:
>>>
>>>> Why doesn't right clicking on the batch command to select "run as admin"
>>>> work, when running the batch command in an admin window works just fine?
>>>
>>> It works here. Windows 10 version 21H1.
>>>
>>> 1. I log in to a non-Administrator account.
>>> 2. I right-click on a batch file and choose "Run as Administrator".
>>> 3. At the UAC prompt, I enter the password for the Administrator
>>> account.
>>> 3. A command prompt window appears.
>>> 4. If the batch file contains the command WHOAMI then the command
>>> prompt window displays the name of the Administrator account,
>>> not the name of my non-Administrator account which I ran it from.
>>> 5. Task Manager 'details' tab shows the user for both conhost.exe
>>> and cmd.exe as being the Administrator account, not my
>>> non-Administrator account which I ran it from.
>>>
>>> What it is that leads you to believe it is not working for you?
>>
>> An example of a command and .bat file might be
>>
>> whoami /user /priv
>> pause
>>
>> This will show differences between an elevated attempt and
>> one which is not elevated.
>
> That confirms it is elevated when I right-click on a batch file
> and choose "Run as Administrator". The same as when I run the batch
> command in an 'Administrator' Command Prompt window.
>
> I also confirmed it is elevated by having the batch run a command
> ('openfiles') which requires elevation, and checking %ERRORLEVEL%.
>
> So the OP's problem does not look to be related to elevation.

The problem was that I didn't realize that the Windows File Explorer uses a
completely different path than does the elevated Windows command line.

Thanks for testing elevation permissions on the one-line batch file:
REM freeopenvpn.bat
c:\path-to\openvpn.exe C:\full-path-to\configs\freeopenvpn.ovpn

That command above worked when run inside an administrator command window.
But it had failed when right clicked to "Run as administrator" in the FE.

The problem turned out to be exactly what Herbert Kleebauer suggested I test
by adding a trailing "pause" to the one-line batch file as shown below.

REM freeopenvpn.bat
c:\path-to\openvpn.exe C:\full-path-to\configs\freeopenvpn.ovpn
pause

That pause allowed the OpenVPN error message to show up, which was:
Options error: --auth-user-pass fails with 'freeopenvpn.txt':
No such file or directory (errno=2)

Herbert Kleebauer was right that the problem was Windows File Explorer used
a different set of paths than did the Windows administrator command window.

I needed to force Windows File Explorer to "see" the full path to the
"freeopenvpn.txt" login/password file (which is a different use model than
the freeopenvpn.org web site espouses, so I was breaking the ovpn file).
https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en

I first tried modifying freeopenvpn.ovpn with only single backslashes:
auth-user-pass C:\full-path-to\configs\freeopenvpn.txt

But that gave a readable error that I should use double backslashes:
auth-user-pass C:\\full-path-to\\configs\\freeopenvpn.txt

As a separate solution, adding the "cd" to the batch file also worked:

REM freeopenvpn.bat
cd c:\full-path-to\configs\
c:\path-to\openvpn.exe C:\full-path-to\configs\freeopenvpn.ovpn
pause

Now no matter what I do, the openvpn.bat works correctly when elevated.

A. In File Explorer, I right click freeopenvpn.bat & run as administrator
B. In an administrator command windows I run "freeopenvpn.bat"
C. In an administrator command window I cut and paste the full command
c:\path-to\openvpn.exe C:\full-path-to\configs\freeopenvpn.ovpn

The first problem was that I wasn't using the freeopenvpn.ovpn file the way
the freeopenvpn.org web site had assumed I would (where you type in the
login and password manually when prompted - which I am doing automatically).

The second problem was that I couldn't get the error message out of the
Windows File Explorer method, which the added "pause" allowed me to see.

The third problem (and the only real problem) was that I didn't realize that
the elevated Windows command line used a different path than the Windows
File Explorer elevated action.

Once I realized that the openvpn.exe client didn't know the full path to the
login/password file in the Windows File Explorer (thanks to Herbert's
suggestions), the only minor remaining problem was figuring out that batch &
ovpn syntax to specify a full path to the "freeopenvpn.txt" freeopenvpn.org
daily login/password file.

Now it's all automatic with a simple right click run-as-admin in Windows FE!
--
(My next task is to figure out how to wget the captcha-like daily password.)
wget -WHAT? https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shj746$95n$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55302&group=alt.comp.os.windows-10#55302

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Zaidy036@air.isp.spam (Zaidy036)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 17:29:43 -0400
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <shj746$95n$1@dont-email.me>
References: <she5mh$17nl$1@gioia.aioe.org>
<a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org>
<shhrcb$cgu$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 11 Sep 2021 21:29:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0d2f2d4907ef6bdb11ed5fc1f801e6e0";
logging-data="9399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1895KffZrHkDUOT8wwTMpNsCgMjWW54IeE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:O9Wo5pmRPt1O2YeW6nZQ7Xv4Ji4=
In-Reply-To: <shhrcb$cgu$1@gioia.aioe.org>
Content-Language: en-US
 by: Zaidy036 - Sat, 11 Sep 2021 21:29 UTC

On 9/11/2021 5:03 AM, Herbert Kleebauer wrote:
> On 10.09.2021 23:40, Scott Lurndal wrote:
>
>> Exact same one line batch file command is being run in both cases above.
>>    freeopenvpn.bat
>>    c:\path-to\openvpn\bin\openvpn.exe freeopenvpn.ovpn
>
>> a. When it works, I type "freeopenvpn.bat" & [Enter] in an admin window.
>> b. When it fails, I rightclick "freeopenvpn.bat" & run-as-administrator.
>
>> For whatever reason, my "command prompt" is instantaneous.
>> It disappears in a nanosecond so I can't tell what it's doing inside.
>
> Then insert a "pause" command at the end of the batch file so the
> window stays open.
>
> And don't forget, when you run the batch by a right click, there is a
> different working directory as when run in a command window. Insert
> a cd command at the beginning of the batch to have the same working
> directory as with you command window.

easier to use "CMD /K" so batch ends but leaves window open and usable

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<kp8qjg5rq87ne69hrbv9g1uffk129rcms9@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55303&group=alt.comp.os.windows-10#55303

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx37.iad.POSTED!not-for-mail
From: -rf-nz-@-.invalid (Ralph Fox)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Message-ID: <kp8qjg5rq87ne69hrbv9g1uffk129rcms9@4ax.com>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org> <shj746$95n$1@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Face: 5gSW~"1=jGDo(BXfTrgL2BnC3tUB_\d0u@mP~wA1fvK`z8I[>1jXVVZ!N6ittQ.K<5!i3l> ==jcyAk.[B>kLg8TY{+8%edZ(le:ncPt%s8Pr?]QXNXO]0RC#V_zt|%>=bt>rZ2iCI^-yl7Be(]Ep> OfyI!3Bf|e
Lines: 28
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sun, 12 Sep 2021 09:48:16 +1200
X-Received-Bytes: 1999
 by: Ralph Fox - Sat, 11 Sep 2021 21:48 UTC

On Sat, 11 Sep 2021 17:29:43 -0400, Zaidy036 wrote:
> On 9/11/2021 5:03 AM, Herbert Kleebauer wrote:
>> On 10.09.2021 23:40, Scott Lurndal wrote:
>>
>>> For whatever reason, my "command prompt" is instantaneous.
>>> It disappears in a nanosecond so I can't tell what it's doing inside.
>>
>> Then insert a "pause" command at the end of the batch file so the
>> window stays open.
>>
>> And don't forget, when you run the batch by a right click, there is a
>> different working directory as when run in a command window. Insert
>> a cd command at the beginning of the batch to have the same working
>> directory as with you command window.
>
> easier to use "CMD /K" so batch ends but leaves window open and usable

The case in question is when you run the batch by:
right-click >> Run As Administrator.

The case in question does not use "CMD /K".

--
Kind regards
Ralph
🦊

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shjc40$php$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55311&group=alt.comp.os.windows-10#55311

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sat, 11 Sep 2021 18:54:57 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <shjc40$php$2@dont-email.me>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org> <shj746$95n$1@dont-email.me> <kp8qjg5rq87ne69hrbv9g1uffk129rcms9@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Sep 2021 22:54:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="253a26a0af96c42b54c505cd1b216066";
logging-data="26169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196JKbN1Pm0eua5XtiLgNx0qe6gGxfUy2w="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:iwufBi02ILbnM5cUE/Rb5r+cS9o=
In-Reply-To: <kp8qjg5rq87ne69hrbv9g1uffk129rcms9@4ax.com>
 by: Paul - Sat, 11 Sep 2021 22:54 UTC

Ralph Fox wrote:
> On Sat, 11 Sep 2021 17:29:43 -0400, Zaidy036 wrote:
>> On 9/11/2021 5:03 AM, Herbert Kleebauer wrote:
>>> On 10.09.2021 23:40, Scott Lurndal wrote:
>>>
>>>> For whatever reason, my "command prompt" is instantaneous.
>>>> It disappears in a nanosecond so I can't tell what it's doing inside.
>>> Then insert a "pause" command at the end of the batch file so the
>>> window stays open.
>>>
>>> And don't forget, when you run the batch by a right click, there is a
>>> different working directory as when run in a command window. Insert
>>> a cd command at the beginning of the batch to have the same working
>>> directory as with you command window.
>> easier to use "CMD /K" so batch ends but leaves window open and usable
>
>
> The case in question is when you run the batch by:
> right-click >> Run As Administrator.
>
> The case in question does not use "CMD /K".

You could try sticking a pause in your batch file.

Paul

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<tmeqjgtea4ovij4nl7cp1mp8e4uo5rbcv5@4ax.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55315&group=alt.comp.os.windows-10#55315

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx02.iad.POSTED!not-for-mail
From: -rf-nz-@-.invalid (Ralph Fox)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Message-ID: <tmeqjgtea4ovij4nl7cp1mp8e4uo5rbcv5@4ax.com>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org> <shj746$95n$1@dont-email.me> <kp8qjg5rq87ne69hrbv9g1uffk129rcms9@4ax.com> <shjc40$php$2@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Face: 5gSW~"1=jGDo(BXfTrgL2BnC3tUB_\d0u@mP~wA1fvK`z8I[>1jXVVZ!N6ittQ.K<5!i3l> ==jcyAk.[B>kLg8TY{+8%edZ(le:ncPt%s8Pr?]QXNXO]0RC#V_zt|%>=bt>rZ2iCI^-yl7Be(]Ep> OfyI!3Bf|e
Lines: 27
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sun, 12 Sep 2021 11:30:40 +1200
X-Received-Bytes: 1842
 by: Ralph Fox - Sat, 11 Sep 2021 23:30 UTC

[Scott Lurndal]
>>>>> For whatever reason, my "command prompt" is instantaneous.
>>>>> It disappears in a nanosecond so I can't tell what it's doing inside.

[Herbert Kleebauer]
>>>> Then insert a "pause" command at the end of the batch file so the
>>>> window stays open.

[Zaidy036]
>>> easier to use "CMD /K" so batch ends but leaves window open and usable

[Ralph Fox]
>> The case in question is when you run the batch by:
>> right-click >> Run As Administrator.
>> The case in question does not use "CMD /K".

[Paul]
> You could try sticking a pause in your batch file.

That is what Herbert Kleebauer already wrote.

--
Kind regards
Ralph
🦊

Re: Why Windows 10 batch admin isn't the same as its GUI admin?

<shjqg4$uoh$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=55324&group=alt.comp.os.windows-10#55324

  copy link   Newsgroups: alt.comp.os.windows-10 alt.comp.microsoft.windows alt.msdos.batch
Path: i2pn2.org!i2pn.org!aioe.org!axchmTDYVsEcI97kMu0dvw.user.46.165.242.75.POSTED!not-for-mail
From: scott@slp53.sl.home (Scott Lurndal)
Newsgroups: alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Subject: Re: Why Windows 10 batch admin isn't the same as its GUI admin?
Date: Sun, 12 Sep 2021 06:00:23 +0300
Organization: UsenetServer - www.usenetserver.com
Message-ID: <shjqg4$uoh$1@gioia.aioe.org>
References: <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org> <shj746$95n$1@dont-email.me>
Reply-To: slp53@pacbell.net
Injection-Info: gioia.aioe.org; logging-data="31505"; posting-host="axchmTDYVsEcI97kMu0dvw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-newsreader: xrn 9.03-beta-14-64bit
 by: Scott Lurndal - Sun, 12 Sep 2021 03:00 UTC

Zaidy036 writes:
> easier to use "CMD /K" so batch ends but leaves window open and usable

Done.
Please see improvements to the tutorial for all to test, below.

Tutorial: How to use freeopenvpn on Windows 10 from the command line
(Please add improvements, e.g., how to wget the password would be nice.)
(Also how to doubleclick on the OVPN files & bypass UAC would be nice.)

1. I assume you've already installed any decent free openvpn client.
This is the one I'd use (but I don't use the GUI that most would use).
https://openvpn.net/community-downloads/

For example, this is the most common 64-bit openvpn.exe client:
https://swupdate.openvpn.org/community/releases/OpenVPN-2.5.3-I601-amd64.msi

2. Then download any free openvpn configuration file off the net.
You can get these free configuration files from many locations.

This is just one common free example (password changes daily):
https://www.freeopenvpn.org/
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn

Here is another common free set of openvpn configuration files:
https://vanwa.tech/vpn
https://vanwa.tech/free-openvpn-service
https://vanwa.tech/download-free-openvpn-config

And others which don't even require a change of login/password:
https://www.vpngate.net/en/

For example, this file changes infrequently during the year.
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn

Save that file to wherever you want to store your VPN configs.
c:\pathto\configs\freeopenvpn.ovpn

3. Create a freeopenvpn.txt text file for the login & daily password.
notepad.exe freeopenvpn.txt

Each OpenVPN config file can authenticate differently.
Adjust what you do based on their authentication method.
For example, for freeopenvpn.org, I'd create a login/password file.

In that file I'd put the current login & password, each on a line.
freeopenvpn
173975185

Note that the freeopenvpn.org password changes frequently.

4. Then I'd modify the config file to find the login/password.
C:\> notepad.exe USA_freeopenvpn_udp.ovpn

Change this line from:
auth-user-pass
Change that line to the full path to the login/password file:
auth-user-pass c:\\pathto\\configs\\freeopenvpn.txt

5. Create a batch command to run VPN for you as administrator.
notepad.exe freeopenvpn.bat

In that file you can add one line to call the desired config file.
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn

If desired, add paths, variables and/or a pause in case of error.

REM freeopenvpn.bat
cd c:\pathto\configs\
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn
pause

Or, if you want to use variables, something like this would be ok:
REM freeopenvpn.bat
REM https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en
set configdir=c:\pathto\configs\
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configfile=freeopenvpn.ovpn
cd $configdir
%configcmd% %configdir%%configfile%
pause

6. Now you can get on that free VPN by any of a few efficient methods:

I usually run it from the command line inside an administrator window:
Win+R > cmd{ctrl+shft+rtn}
C:\> .\freeopenvpn.bat

But you can also run it as admin via the Windows File Explorer.
{Rightclick on freeopenvpn.bat}{Select "Run as administrator"}

Or, in an administrator window, you can directly run the commands:
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn

Note that you must run openvpn.exe as admin on Windows 10.
Otherwise it won't be able to successfully modify the routing table.

You can check the routing table before and after running the command:
route print | more

7. Doublecheck that you are on VPN if you're not sure you're connected.
Win+R > cmd{Enter}
C:\> curl icanhazip.com
That should return whatever IP address you're connected as.

You can create a command to run in the Run box if you like.
REM curlit.bat
%comspec% /k curl icanhazip.com

8. Each day you want to use VPN, check for the new password:
https://www.freeopenvpn.org/

a. Modify the password line, as needed, of the freeopenvpn.txt file.
b. Press "F4" in the resulting command window when you wish to exit.

9. Steps are similar for https://vanwa.tech and in some ways even simpler:
REM vanwa.bat
REM https://vanwa.tech/download-free-openvpn-config
set configfile=vanwa.ovpn
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configdir=c:\pathto\configs\
cd $configdir
%configcmd% %configdir%%configfile%
pause

10. Steps are similar but with different proclivities for vpngate.net:
REM vpngate.net
set configfile=vpngate.ovpn
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configdir=c:\pathto\configs\
cd $configdir
%configcmd% %configdir%%configfile%
pause

In summary, this tutorial provides a step by step tested sequence
that allows you efficiently to be on any one set of free public VPNs
using the Windows 10 command line or Windows 10 File Explorer.

Let me know if you have further improvements for all to benefit from
(e.g., to wget the password file daily automatically would be nice,
and it would be nice to set up Windows 10 so as to run openvpn.exe as
admin when any ovpn file is doubleclicked on in the Windows File Explorer.)

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor