Windows 24H2 issues with commands performed in Command Prompt with elevated privileges


pjduplooy

Member
Local time
9:29 PM
Posts
6
OS
Windows 11
Hi Guys.

I have recently updated to Windows 11 24H2 from 23H2. (This also happens on a clean install of 24H2 with the device formatted).

I have to perform certain tasks in a Command Prompt with elevated privileges, especially after the install of new Nvidia Drivers, where I have to delete certain files in C:\Windows\System32\lxss\lib, and then create symlinks in that folder - This is for use in WSL.

The problem I have is that 24H2 does not allow me to perform the actions of deleting and symlinking. (As stated this is in Command Prompt with elevated privileges).

In Windows 11 23H2 this is possible.

After I rolled back from Windows 11 24H2 to 23H2, it worked again. I thought doing a clean install of Windows 11 24H2 might resolve the issue, but it did not.

I have tried using a standard sudo, (no changes to settings), but that also did not work.

The error that I get in all the scenarios is "Access Denied.

Could you please assist me in fixing this?

Regards.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI
I think you must first take ownership of the specific folder and all subfolders and files, probably current owner is TrustedInstaller, you must change that to Administrators group. Then you have to modify access rights of that folder and all subfolders and files to give full access to the Administrators group. Now your actions should complete successfully. Maybe this wasn't necessary in 23H2, but probably in 24H2 Microsoft enhanced security. To do these, right-click on the folder, select Properties and go to the Security tab. Click Advanced and proceed from there.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 (build 22631.4249) test laptop, Windows 11 Pro v24H2 (build 26100.3476) main PC
    Computer type
    Laptop
    Manufacturer/Model
    Acer Extensa 5630EZ
    CPU
    Mobile DualCore Intel Core 2 Duo T7250, 2000 MHz
    Motherboard
    Acer Extensa 5630
    Memory
    4GB
    Graphics Card(s)
    Mobile Intel(R) GMA 4500M (Mobile 4 series)
    Sound Card
    Realtek ALC268 @ Intel 82801IB ICH9 - High Definition Audio Controller
    Monitor(s) Displays
    1
    Screen Resolution
    1280x800
    Hard Drives
    Samsung SSD 850 EVO 250GB SATA Device (250 GB, SATA-III)
    Internet Speed
    VDSL 50 Mbps
    Browser
    MICROSOFT EDGE
    Antivirus
    WINDOWS DEFENDER
    Other Info
    Legacy MBR installation, no TPM, no Secure Boot, no WDDM 2.0 graphics drivers, no SSE4.2, cannot get more unsupported ;) This is only my test laptop. I had installed Windows 11 here before upgrading my main PC. For my main PC I use everyday see my 2nd system specs.
  • Operating System
    Windows 11 Pro v24H2 (build 26100.3476)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom-built PC
    CPU
    Intel Core-i7 3770 3.40GHz s1155 (3rd generation)
    Motherboard
    Asus P8H61 s1155 ATX
    Memory
    2x Kingston Hyper-X Blu 8GB DDR3-1600
    Graphics card(s)
    Gainward NE5105T018G1-1070F (nVidia GeForce GTX 1050Ti 4GB GDDR5)
    Sound Card
    Realtek HD audio (ALC887)
    Monitor(s) Displays
    Sony Bravia KDL-19L4000 19" LCD TV via VGA
    Screen Resolution
    1440x900 32-bit 60Hz
    Hard Drives
    WD Blue SA510 2.5 1000GB SSD as system disk, Western Digital Caviar Purple 4TB SATA III (WD40PURZ) as second
    PSU
    Thermaltake Litepower RGB 550W Full Wired
    Case
    SUPERCASE MIDI-TOWER
    Cooling
    Deepcool Gamma Archer CPU cooler, 1x 8cm fan at the back
    Mouse
    Sunnyline OptiEye PS/2
    Keyboard
    Mitsumi 101-key PS/2
    Internet Speed
    100Mbps
    Browser
    Microsoft Edge, Mozilla Firefox
    Antivirus
    Microsoft Windows Defender
    Other Info
    Legacy BIOS (MBR) installation, no TPM, no Secure Boot, WDDM 3.0 graphics drivers, WEI score 7.4
Thanks a million. I suspected as much. Will upgrade again later and give feedback
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI
Thanks a million. I suspected as much. Will upgrade again later and give feedback

Hello @pjduplooy and welcome to ElevenForum. :-)








_______________________________________________________________________________________________________________________________

Here's some other things that you may find useful...



 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦26100.3775 ♦♦♦♦♦♦♦24H2 ♦♦♦non-Insider
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 5002)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 15 years?
I have to perform certain tasks in a Command Prompt with elevated privileges, especially after the install of new Nvidia Drivers, where I have to delete certain files in C:\Windows\System32\lxss\lib, and then create symlinks in that folder - This is for use in WSL.

The problem I have is that 24H2 does not allow me to perform the actions of deleting and symlinking. (As stated this is in Command Prompt with elevated privileges).
Could you please post an example of a team that should complete the task you set so that I can experiment with it.
 

My Computer

System One

  • OS
    Windows 11 Stable, Release Preview, Beta (both), Dev, Canary
    Computer type
    PC/Desktop
    Manufacturer/Model
    Micro-Star International Co., Ltd. MS-7D54
    CPU
    AMD Ryzen 9 PRO 5950X
    Motherboard
    MSI MAG X570S Tomahawk Max WiFi (MS-7D54) (2 PCI-E x1, 2 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, 2.5GbE LAN, WiFi)
    Memory
    128 Gb
    Graphics Card(s)
    Intel(R) Arc(TM) A380 Graphics (2 ГБ)
    Sound Card
    Устройство с поддержкой High Definition Audio
    Monitor(s) Displays
    HP X34 [34" LCD] (6CM1300J5J) {2021}
    Screen Resolution
    3440x1440
    Hard Drives
    KINGSTON SFYRD2000G (2000 ГБ, PCI-E 4.0 x4)
    PSU
    Be Quiet! Dark Rock Pro 4
    Case
    Cooler Master HAF XB EVO
    Internet Speed
    1000 Mb/s
    Browser
    Chrome
    Antivirus
    Windows Defender
Hi Dronix. I do not understand your request.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI
Hi Dronix. I do not understand your request.


Translation... Post an example of something you tried, that didn't work on 24H2.
So, he can experiment and see if he can find a solution.

Like one of the exact commands you tried.
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦26100.3775 ♦♦♦♦♦♦♦24H2 ♦♦♦non-Insider
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 5002)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 15 years?

My Computer

System One

  • OS
    Windows 11 Stable, Release Preview, Beta (both), Dev, Canary
    Computer type
    PC/Desktop
    Manufacturer/Model
    Micro-Star International Co., Ltd. MS-7D54
    CPU
    AMD Ryzen 9 PRO 5950X
    Motherboard
    MSI MAG X570S Tomahawk Max WiFi (MS-7D54) (2 PCI-E x1, 2 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, 2.5GbE LAN, WiFi)
    Memory
    128 Gb
    Graphics Card(s)
    Intel(R) Arc(TM) A380 Graphics (2 ГБ)
    Sound Card
    Устройство с поддержкой High Definition Audio
    Monitor(s) Displays
    HP X34 [34" LCD] (6CM1300J5J) {2021}
    Screen Resolution
    3440x1440
    Hard Drives
    KINGSTON SFYRD2000G (2000 ГБ, PCI-E 4.0 x4)
    PSU
    Be Quiet! Dark Rock Pro 4
    Case
    Cooler Master HAF XB EVO
    Internet Speed
    1000 Mb/s
    Browser
    Chrome
    Antivirus
    Windows Defender
C:
cd \Windows\System32\lxss\lib
del libcuda.so
del libcuda.so.1
mklink libcuda.so libcuda.so.1.1
mklink libcuda.so.1 libcuda.so.1.1
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI
C:
cd \Windows\System32\lxss\lib
del libcuda.so
del libcuda.so.1
mklink libcuda.so libcuda.so.1.1
mklink libcuda.so.1 libcuda.so.1.1
I don't know if I fully understood you, but I made a small bat file and a small video of how it works.

@echo off
:: Created by Dronix7 13.11.2024 UpDated 13.11.2024
mode con:cols=70 lines=8 & echo.
:: ============================== Checking Administrator Rights =============================
call :StartAdmin
:: ==========================================================================================
cd /d %SystemRoot%\System32\lxss\lib
del libcuda.so
del libcuda.so.1
echo.
pause
:: ==========================================================================================
echo.
mklink libcuda.so libcuda.so.1.1
mklink libcuda.so.1 libcuda.so.1.1
echo.
pause
:: == If the File Is Running Without Administrator Rights, then Run it as an Administrator ==
:StartAdmin
reg query "HKU\S-1-5-19\Environment" >nul 2>&1
if not %errorlevel% EQU 0 (
cls
powershell.exe -windowstyle hidden -noprofile "Start-Process '%~dpnx0' -Verb RunAs"
echo Запуск от Имени Администратора...
exit
)
cls & goto:eof
:: ==========================================================================================

And a short video


The finished bat file - Example.bat
 

My Computer

System One

  • OS
    Windows 11 Stable, Release Preview, Beta (both), Dev, Canary
    Computer type
    PC/Desktop
    Manufacturer/Model
    Micro-Star International Co., Ltd. MS-7D54
    CPU
    AMD Ryzen 9 PRO 5950X
    Motherboard
    MSI MAG X570S Tomahawk Max WiFi (MS-7D54) (2 PCI-E x1, 2 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, 2.5GbE LAN, WiFi)
    Memory
    128 Gb
    Graphics Card(s)
    Intel(R) Arc(TM) A380 Graphics (2 ГБ)
    Sound Card
    Устройство с поддержкой High Definition Audio
    Monitor(s) Displays
    HP X34 [34" LCD] (6CM1300J5J) {2021}
    Screen Resolution
    3440x1440
    Hard Drives
    KINGSTON SFYRD2000G (2000 ГБ, PCI-E 4.0 x4)
    PSU
    Be Quiet! Dark Rock Pro 4
    Case
    Cooler Master HAF XB EVO
    Internet Speed
    1000 Mb/s
    Browser
    Chrome
    Antivirus
    Windows Defender
Hi guys. Thanks for all the help. Before I wanted to try all your suggestions, I opened one of my WSL Instances, and got this error:

wsl: Access is denied.
Error code: CreateInstance/CreateVm/ConfigureNetworking/HNS/E_ACCESSDENIED
wsl: Failed to configure network (networkingMode Nat), falling back to no networking.

Reverting back to 23H2
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI
I have to perform certain tasks in a Command Prompt with elevated privileges, especially after the install of new Nvidia Drivers, where I have to delete certain files in C:\Windows\System32\lxss\lib, and then create symlinks in that folder - This is for use in WSL.

The problem I have is that 24H2 does not allow me to perform the actions of deleting and symlinking. (As stated this is in Command Prompt with elevated privileges).
As you observed you do not have permissions to do this. However, with administrative rights, you have backup and restore privileges available to you.

if you save the following two line vbscript, and run it from an elevated command prompt it will spawn a new cmd window which has the privileges enabled.

Code:
Set Process = GetObject("winmgmts:{impersonationLevel=impersonate, (backup, restore)}!\\.\root\cimv2:Win32_Process")
Process.Create "cmd", Null, Null, ProcessID

You can then run your batch script.

Having restore privileges makes window ignore the permissions on files and folders. So you can make changes which don't require reading or writing file content. If you need to do that there's a command line utility robocopy which has a /b option which allows you to read and write anywhere. It's available in all recent versions of windows.

This saves you from messing with permissions. - Providing you're comfortable with command line programs.

Mike
 

My Computer

System One

  • OS
    Windows 11 23H2 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    i3-1215U
    Memory
    8GB
    Monitor(s) Displays
    Dell S2721
    Screen Resolution
    3840x2160
    PSU
    External 65W
    Keyboard
    Cherry mechanical (Blue)
    Mouse
    Microsoft
    Browser
    FireFox
    Antivirus
    MS
As you observed you do not have permissions to do this. However, with administrative rights, you have backup and restore privileges available to you.

if you save the following two line vbscript, and run it from an elevated command prompt it will spawn a new cmd window which has the privileges enabled.

Code:
Set Process = GetObject("winmgmts:{impersonationLevel=impersonate, (backup, restore)}!\\.\root\cimv2:Win32_Process")
Process.Create "cmd", Null, Null, ProcessID

You can then run your batch script.

Having restore privileges makes window ignore the permissions on files and folders. So you can make changes which don't require reading or writing file content. If you need to do that there's a command line utility robocopy which has a /b option which allows you to read and write anywhere. It's available in all recent versions of windows.

This saves you from messing with permissions. - Providing you're comfortable with command line programs.
It works, but the new cmd window won't let you change the owner back to TrustedInstaller (i.e., with
icacls "C:\Path\To\File\Or\Folder" /setowner "NT SERVICE\TrustedInstaller") after you took ownership of a file/folder (i.e., with
takeown /f "C:\Path\To\File\Or\Folder"). So, to work around that problem, you can edit your vbscript code:
Code:
Set Process = GetObject("winmgmts:{impersonationLevel=impersonate, (backup, restore, takeownership)}!\\.\root\cimv2:Win32_Process")
Process.Create "cmd", Null, Null, ProcessID
When in doubt, to be able to see the owner of a file/folder via the command line, you can run this:
Code:
powershell -noprofile -executionpolicy bypass -command (get-acl "C:\Path\To\File\Or\Folder").owner
Taking ownership lets you easily conveniently use File Explorer as opposed to use robocopy with the /b option. I know that a lot of people simply never bother to change it back to TrustedInstaller after they took ownership to modify the content. Personally, I, always prefer to change it back.
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
if you open 'task manager'
r/click the start menu on this menu its about 7th up from the bottom.

when task manager opens at the top is 'run new task' click that.

in the command window write >> cmd << for the command prompt
or >> powershell << for the windows powershell

make sure to TICK ''create this task with administrative privileges"
then click OK or press ENTER.

this will open the command prompt or powershell as admin bypassing any restrictions.

this happened to me but suddenly after the last updates its now back to normal.
best of luck, Steve ..
 

My Computers

System One System Two

  • OS
    .. Debian 13 'Testing' .. Windows 11 24H2 Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP 24" AiO
    CPU
    Ryzen 7 5825u
    Motherboard
    HP
    Memory
    64GB DDR4 3200
    Graphics Card(s)
    Ryzen 7 5825u
    Sound Card
    RealTek
    Monitor(s) Displays
    24" HP AiO
    Hard Drives
    1TB WD Blue SN580 M2 SSD Partitioned.
    2x 1TB USB HDD External Backup/Storage.
    Internet Speed
    900MB full fibre
    Browser
    Firefox ESR & Thunderbird
    Antivirus
    ClamAV TK
    Other Info
    Mainly Open Source Software
  • Operating System
    Ubuntu 22.04.5 LTS
    Computer type
    Laptop
    Manufacturer/Model
    Dell 13" Latitude 2017
    CPU
    i5 7200u
    Motherboard
    Dell
    Memory
    16GB DDR4
    Graphics card(s)
    Intel
    Sound Card
    Intel
    Monitor(s) Displays
    13" Dell Laptop
    Hard Drives
    250GB Crucial 2.5" SSD
    Mouse
    Gerenic 3 button
    Internet Speed
    WiFi only
    Browser
    FireFox
    Antivirus
    ClamAV TK
    Other Info
    Mainly Open Source Software
Hi. Thank you for all your suggestions.

I fixed this with Skeptic Mike's Visual Basic Script.

I have learnt a lot about Windows and its peculiarities the last two days.

Happy camper now!!

Thanks guys!!
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    MSI

Latest Support Threads

Back
Top Bottom