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


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

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

From Scott Lurndal <scott@slp53.sl.home>
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 2021-09-11 13:00 +0300
Organization UsenetServer - www.usenetserver.com
Message-ID <shhuna$1p5o$1@gioia.aioe.org> (permalink)
References <she5mh$17nl$1@gioia.aioe.org> <a9vljg9tspkefitk4ao7qr076t60ron1r1@4ax.com> <shgjd7$1206$1@gioia.aioe.org> <shhrcb$cgu$1@gioia.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


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

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


Thread

Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-10 02:34 +0300
  Re: Why Windows 10 batch admin isn't the same as its GUI admin? Ralph Fox <-rf-nz-@-.invalid> - 2021-09-10 19:08 +1200
    Re: Why Windows 10 batch admin isn't the same as its GUI admin? Paul <nospam@needed.invalid> - 2021-09-10 04:45 -0400
      Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 12:18 +0300
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Andy Burns <usenet@andyburns.uk> - 2021-09-11 10:26 +0100
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 22:08 +0300
            Re: Why Windows 10 batch admin isn't the same as its GUI admin? Andy Burns <usenet@andyburns.uk> - 2021-09-11 20:15 +0100
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-12 13:25 +0300
      Re: Why Windows 10 batch admin isn't the same as its GUI admin? Ralph Fox <-rf-nz-@-.invalid> - 2021-09-12 06:58 +1200
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 22:59 +0300
    Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 00:40 +0300
      Re: Why Windows 10 batch admin isn't the same as its GUI admin? Andy Burns <usenet@andyburns.uk> - 2021-09-11 08:57 +0100
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 11:26 +0300
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 11:33 +0300
            Re: Why Windows 10 batch admin isn't the same as its GUI admin? Andy Burns <usenet@andyburns.uk> - 2021-09-11 09:44 +0100
      Re: Why Windows 10 batch admin isn't the same as its GUI admin? Herbert Kleebauer <klee@unibwm.de> - 2021-09-11 11:03 +0200
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Andy Burns <usenet@andyburns.uk> - 2021-09-11 10:05 +0100
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Ralph Fox <-rf-nz-@-.invalid> - 2021-09-12 07:15 +1200
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 13:00 +0300
        Re: Why Windows 10 batch admin isn't the same as its GUI admin? Zaidy036 <Zaidy036@air.isp.spam> - 2021-09-11 17:29 -0400
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Ralph Fox <-rf-nz-@-.invalid> - 2021-09-12 09:48 +1200
            Re: Why Windows 10 batch admin isn't the same as its GUI admin? Paul <nospam@needed.invalid> - 2021-09-11 18:54 -0400
              Re: Why Windows 10 batch admin isn't the same as its GUI admin? Ralph Fox <-rf-nz-@-.invalid> - 2021-09-12 11:30 +1200
                Re: Why Windows 10 batch admin isn't the same as its GUI admin? Paul <nospam@needed.invalid> - 2021-09-11 23:47 -0400
          Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-12 06:00 +0300
            Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-12 12:11 +0300
  Re: Why Windows 10 batch admin isn't the same as its GUI admin? JJ <jj4public@gmail.com> - 2021-09-10 16:47 +0700
    Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-11 00:22 +0300
  Re: Why Windows 10 batch admin isn't the same as its GUI admin? Brian Gregory <void-invalid-dead-dontuse@email.invalid> - 2021-09-12 10:25 +0100
    Re: Why Windows 10 batch admin isn't the same as its GUI admin? Scott Lurndal <scott@slp53.sl.home> - 2021-09-12 14:34 +0300

csiph-web