Too many steps and still you have a cmd command running every 12 hours a day.
the best way still this bellow, I tested with several you need to restart, and really works.
___________________________
Step 1: Ge the Run dialog by pressing Win + R, type regedit, and click OK to launch Registry Editor.
Step 2: Click Yes to grant admin access in the pop-up window.
Step 3: Go to the path – Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows.
Step 4: Right-click on the Windows folder and choose New > Key. Name it as Windows Update.
Step 5: Right-click on Windows Update and select New > Key. Name the new key as AU.
Step 6: Click on the newly created key, right-click on the empty space and choose New > DWORD (32-bit Value). Name it as NoAutoRebootWithLoggedOnUser.
Step 7: Double-click on the new item, set Base to Hexadecimal, set Value data to 1, and click OK to save the modification.
_____________________
fewer steps and no need to use tasks