View Single Post
  #3  
Old August 19th 20, 06:53 AM posted to alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.msdos.batch
Arlen Holder
external usenet poster
 
Posts: 186
Default Expert help requested for removing UAC user account control task scheduler syntax

On Tue, 18 Aug 2020 22:11:55 -0000 (UTC), Arlen Holder wrote:

It's a SYNTAX problem that I'm hoping someone on this newsgroup knows how to solve.


As another useful example that others may benefit from, try this:
o Summary: [Note: Use any paths you like; I'm just pasting below from my logs.]

To kill your network (e.g., when installing programs), just run "killgw".
o Here is how to set up that "killgw" kill-gateway command in minutes:

1. Obtain the LiquidVPN network-kill-switch batch file:
https://www.liquidvpn.com/vpn-kill-switches/

The batch text file can be downloaded with this URL:
https://my.liquidvpn.com/dl.php?type=d&id=49
Name: LiquidVPN-Kill-Switch.bat
Size: 2747 bytes (2 KiB)
SHA256: 933B7BD76EECB04D57A1A55E972C868D0460EB21021C16ED0A BC0B02EBD532A7

2. Rename the file to killgw.bat and put into your system directory, e.g.,
c:\data\sys\batch\killgw.bat

Manually edit the default gatway from 192.168.0.1 to whatever yours is
(e.g., 192.168.1.1, or whatever).

3. Remove UAC by setting up a scheduled task, shortcut, & app paths:
Win+R taskschd.msc /s Task Scheduler Library RMB Create Task
Name = Killgw Task
Description = Kill the network gateway without UAC popups
[x]Run with highest privileges == this is what bypasses the UAC prompt
Actions New Start a program c:\data\sys\batch\killgw.bat
Arguments = blank
Start in = blank
[OK][OK][File Exit]

Test that your task now runs without those annoying UAC popups:
Win+R C:\Windows\System32\schtasks.exe /run /TN "Killgw Task"

To use an easily remembered command, just create a shortcut with a simple name:
Name = C:\data\sys\apppath\link\killgw.lnk
TARGET = C:\Windows\System32\schtasks.exe /run /TN "Killgw Task"
Startin = %windir%\system32

To simplify execution, point to that shortcut with any desired AppPaths key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
New Key = killgw.exe (note this is just a keyword; the exe doesn't exist!)
default = c:\data\sys\batch\killgw.bat

Voila!

Now, to kill the network gateway without the UAC popups, just type:
Win+R killgw

(Re-establishing the gateway is as simple as re-running the command.)

That works great; but the two syntax problems I'm having with this method a
a. How do we create a usable AppPaths WITHOUT having to also create a shortcut?
b. What is the syntax for commands that have arbitrary file name options, e.g.,
openvpn.exe file1.ovpn
openvpn.exe file2.ovpn
openvpn.exe file3.ovpn
--
Any help on those two syntax problems would be greatly appreciated.
Ads