troytse/wsl-autostart

UAC prompt at boot

Opened this issue · 6 comments

tmpg commented

UAC prompt at boot anyway to avoid this?

Currently, no way to avoid this.
but you can disable the UAC.

I'm getting this as well, kind of annoying but I'll deal with it since it's such a useful script.

qqjt commented

没有必要获取系统权限啊,可以以用户身份启动 wsl 和服务

You can try this way to make wsl appliaction autostart
Win + R, type shell:startup and enter, add start-wsl.vbs in startup folder
Content of start-wsl.vbs

Set ws = WScript.CreateObject("WScript.Shell")
cmd = "C:\Windows\System32\bash.exe -c ""bash /etc/init.sh"""
ws.Run cmd, 0, false
Set ws = Nothing
WScript.quit

then make root as default user,
run in command line

debian config --default-user root
twig commented

https://www.raymond.cc/blog/task-scheduler-bypass-uac-prompt/

Task scheduler (Option 4) always works for me

Some additional changes required:

  • trigger: on login (so it runs automatically)
  • action: instead of running c:\wsl-autostart\start.vbs directly, run wscript with args c:\wsl-autostart\start.vbs (so it doesn't ask "open with basic script host?")

Or Raymond's first option, Winaero Tweaker: Create an elevated shortcut by https://winaero.com/blog/create-elevated-shortcut-to-skip-uac-prompt-in-windows-10/ (or more conveniently by the Winaero Tweaker as pointed out at the end of these instruction) and put it into the startup folder C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup