I ran into a similar issue with a black screen after login, except i couldn’t open task manager. Was able to get mine fixed:
- Ctrl-alt-del. Click the power icon, then hold shift and select restart.
- After it loads, it should open a blue screen. Troubleshoot -> Advanced options -> Startup Settings -> Restart
- Select 6. Enable safe mode with command prompt.
- Log in.
- (probably optional, but did it anyways) Click on the terminal window and type sfc /scannow. Press enter, and wait for it to complete.
- Type explorer. Press enter. This caused the taskbar and the typical windows desktop to appear.
- Press Windows+R and type regedit. Click ok, then yes if you get a prompt.
- On the left side, navigate to Computer -> HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control -> Session Manager -> Environment (click the environment folder).
- If you don’t see windir in the list on the right, add it. Right click an empty space on the right side of the menu, New -> String Value. Type windir, press enter. Double click windir. Under value data: enter C:\Windows
- Press ok, then restart your computer. After logging in the issue was resolved for me.
Turns out I was missing the windir environment variable. Hopefully this helps someone (the other threads out there are locked :’)