Skip to content

Instantly share code, notes, and snippets.

@DoubleLabyrinth
Last active January 17, 2024 03:16
  • Star 26 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save DoubleLabyrinth/ffae94cb9444bbdae1d11deeaa247310 to your computer and use it in GitHub Desktop.
Remove mutant entry in Start: ms-resource:AppName/Text
  1. Run fix.py, a Python3 script, with SYSTEM privilege. (NOT Administrator privilege)

    More detail:

    1. If you don't have Python3, just download Python3 installer with the following links:

      Then open Python3 installer and you get the Python3 setup window. Make sure to check the checkbox "Add Python 3.7 to PATH" before you click on the Install button. So we don’t have to configure the PATH variable manually.

      After the installation is done, you can open Command Prompt and type python to check if succeeded. If nothing wrong, you will get a python shell looking like:

      Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
      Type "help", "copyright", "credits" or "license" for more information.
      >>>
      
    2. Now you have Python3. It's time to launch Command Prompt with SYSTEM privilege.

      • Go to here and download a tool called psexec.

      • Open Command Prompt with Administrator privilege and change current directory to directory where psexec.exe exists.

        Then type

        psexec.exe -i -s -d cmd.exe
        

        and you will get a new Command Prompt with SYSTEM privilege.

    3. In Command Prompt with SYSTEM privilege, change current directory to directory where fix.py exists and type

      fix.py
      

      to run fix.py script. If nothing wrong, the output should be

      Trigger "TRG_AFTER_UPDATE_Package_SRJournal" has been cleared.
      IsInbox of "Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy_xxxxx" has been set to 0.
      Trigger "TRG_AFTER_UPDATE_Package_SRJournal" has been restored.
      
  2. Run PowerShell with Administrator privilege. Execute the following command:

    Get-AppxPackage -all *HolographicFirstRun* | Remove-AppPackage -AllUsers

    to uninstall Microsoft.Windows.HolographicFirstRun.

  3. Reboot

  4. After reboot, kill explorer.exe and ShellExperienceHost.exe in Task Manager.

  5. Task Manager -> File -> Run new task

    Click Browse button.

    In newly-opened window, go to %localappdata%\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy and delete TempState directory.

  6. Start explorer.exe in Task Manager and you will see ms-resource:AppName/Text is gone.

import os, sqlite3
conn = sqlite3.connect(os.path.expandvars(r'%ProgramData%\Microsoft\Windows\AppRepository\StateRepository-Machine.srd'))
cursor = conn.execute(
'''
SELECT _PackageID, PackageFullName FROM main.Package
WHERE PackageFullName LIKE "Microsoft.Windows.HolographicFirstRun%";
'''
)
records_to_update = {}
for row in cursor:
records_to_update[row[0]] = row[1]
cursor = conn.execute(
'''
SELECT name, sql FROM main.sqlite_master
WHERE type = "trigger" AND tbl_name = "Package" AND name LIKE "TRG_AFTER_UPDATE%";
'''
)
triggers_backup = {}
for row in cursor:
triggers_backup[row[0]] = row[1]
# Delete update triggers for table "Package"
for TriggerName, TriggerSQL in triggers_backup.items():
conn.execute(
'''
DROP TRIGGER %s;
''' % TriggerName
)
conn.commit()
print('Trigger "%s" has been cleared.' % TriggerName)
# Set IsInbox to 0
for PackageID, PackageFullName in records_to_update.items():
conn.execute(
'''
UPDATE main.Package SET IsInbox = 0 WHERE _PackageID = %d;
''' % PackageID
)
conn.commit()
print('IsInbox of "%s" has been set to 0.' % PackageFullName)
# Restore triggers
for TriggerName, TriggerSQL in triggers_backup.items():
conn.execute(
'''
%s;
''' % TriggerSQL
)
conn.commit()
print('Trigger "%s" has been restored.' % TriggerName)
Copy link

ghost commented Jul 7, 2019

This worked perfect :) The ONLY thing that was not correct in my case was ShellExperianceHost.exe as it was not showing in Task manager. I continued on and the tutorial completed with a successful removal of the mutant entry :)

Thanks...

@CheonHoPark
Copy link

Hello I am new to programming logic and Python, I am trying to resolve this error. But I am confused. I figured out we are supposed to create our own .py script through note pad. And I put that on the desktop my Python is found in: C:\Users\Kyle R. Balitz\AppData\Local\Programs\Python\Python37 And I am unable to run the script with python? Thank you. I believe I downloaded everything correctly...

image

@DoubleLabyrinth
Copy link
Author

DoubleLabyrinth commented Jul 19, 2019

@CheonHoPark
The problem is that your username has space characters.
You should use a pair of double-quotation-mark to quote the whole path, like:

python.exe "C:\Users\Kyle R. Balitz\Desktop\fix.py"

@skycommand
Copy link

skycommand commented Aug 4, 2019

Does the copy of Python 3 from Microsoft Store work too?

And on a side note, I think by "mutant entry", you mean "zombie shortcut". An item is metaphorically described as a "zombie" if it lingers when it is supposed to die and disappear.

@DoubleLabyrinth
Copy link
Author

DoubleLabyrinth commented Aug 4, 2019

@skycommand

  1. If you can access the Python3 from Microsoft Store in Command Prompt with SYSTEM privilege, it should work.

  2. Yes, I mean "zombie shortcut". The words "mutant entry" were from a question in Microsoft Community. I just picked them handily there.

@brnfra
Copy link

brnfra commented Aug 27, 2019

@DoubleLabyrinth Thank you. Solved here ;

  1. In my case, i created file fix.py in my notepad, copy and paste the fix.py code from here and save in %PYTHON%\Tools\scripts\.
  2. The same way, i followed the path and run psexec.exe -i -s -d cmd.exe, like the readme.md file
  3. Locate the folder %PYTHON%\Tools\scripts\
  4. run python.exe fix.py and follow the readme.md and done.

PS. In task manager look for Details tab will be more easy to find and kill explorer.exe and ShellExperienceHost.exe after reboot. I hope this help.

@67879017
Copy link

Thank you for this method is very effective! ! !
Finally solved the problem of the start menu "ms-resource:AppName/Text"

@RazeSoldier
Copy link

RazeSoldier commented Oct 9, 2019

Hi, I am having trouble using the script.
According readme.md, executing this powershell command is after executing the python script:

Get-AppxPackage -all *HolographicFirstRun* | Remove-AppPackage -AllUsers

But I have not found here before, I have already executed this command before I found here. So I execute the command again, it say "Remove-AppPackage : Element not found".
Then, I kill explorer.exe and ShellExperienceHost.exe and delete TempState directory.
After restart explorer.exe, TempState directory has appeared again. "ms-resource:AppName/Text" has not been removed. Anyone have a solution?

@DoubleLabyrinth
Copy link
Author

@RazeSoldier
Well, deleting TempState directory is just to make sure that some cache is cleared. So it is expected that TempState directory appears again.

If you executed that command and still saw ms-resource:AppName/Text, maybe such mutant entry is not residual that is left by *HolographicFirstRun*. I'm afraid to say you need to find another ways. I can't help you.

@MeridianGH
Copy link

Thank you! This weird entry really bothered me and this fix worked flawlessly!

@laughey
Copy link

laughey commented Jan 14, 2020

Thanks so much - it worked for me, but not before I struggled with python a bit as "system" and not needing to delete ShellExperienceHost.exe in TM (it wasn't there/running).

Other than that, my mutant entry is now a ghost. Many thanks!

@kaizengamer
Copy link

I have a corrupted app that I cannot uninstall and it's inbox is already 0. Can the python script be modified to delete a row instead? If so, how?

@Jean20B
Copy link

Jean20B commented Nov 24, 2020

I have a corrupted app that I cannot uninstall and it's inbox is already 0. Can the python script be modified to delete a row instead? If so, how?

I have the same issue with like 20 apps, same error code but IsInbox is already 0 everywhere

@shocker6
Copy link

shocker6 commented Dec 5, 2020

hey, I have no idea what any of this stuff means but I do have the same problem. I've already installed python (don't know what it's for) I just want this ms resource: AppName off my computer can someone break this down for me, please?

@geepnozeex
Copy link

geepnozeex commented Oct 17, 2021

C:>PsExec64.exe -accepteula -s cmd.exe /c C:\Python\Python37\python.exe C:\fix.py

Traceback (most recent call last):
File "C:\fix.py", line 40, in
''' % PackageID
sqlite3.OperationalError: no such function: is_srjournal_enabled
cmd.exe exited on WIN-1VCFKOM31F9 with error code 1.

@bgiessing
Copy link

I get this error when running fix.py

Traceback (most recent call last):
File "C:\Users<user>\Downloads\fix\fix.py", line 9, in
'''
sqlite3.DatabaseError: file is encrypted or is not a database

@Mythiew
Copy link

Mythiew commented Nov 13, 2021

I get this error when running fix.py

Traceback (most recent call last):
File "C:\Users<user>\Documents\fix.py", line 37, in
conn.execute(
sqlite3.OperationalError: no such function: is_srjournal_enabled

@Mythiew
Copy link

Mythiew commented Nov 13, 2021

I get this error when running fix.py

Traceback (most recent call last): File "C:\Users\Documents\fix.py", line 37, in conn.execute( sqlite3.OperationalError: no such function: is_srjournal_enabled

Does anyone know how to fix this?

@zuoliang
Copy link

On line 18, the trigger name should be changed from "TRG_AFTER_UPDATE%" to "TRG_AFTERUPDATE%"

@powerbroker
Copy link

powerbroker commented Nov 11, 2022

The same bug....

python.exe Appx-NonRemovable-fix.py

Traceback (most recent call last):
File "y:\DL\OS\IdIoT Enterprise LTSC x64!Tools\Appx-NonRemovable-fix.py", line 37, in
conn.execute(
sqlite3.OperationalError: no such function: is_srjournal_enabled

previous post about "TRG_AFTERUPDATE%" in line 18 works for me

@ilhan-athn7
Copy link

I have uninstalled Microsoft Edge succesfully by above fix, (with a small edit), thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment