Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
@naveenm0077
Copy link

naveenm0077 commented Jul 5, 2019

When I ran

fix.py

in Command Prompt with SYSTEM privilege I got:

Can't find a default Python.

I have Python path in user variables for admin, do I have to add it in system variables too?

@mesteele101
Copy link

mesteele101 commented Jul 6, 2019

I got this:

d:\folder>fix.py

Traceback (most recent call last):

  File "D:\folder\fix.py", line 9, in <module>

    '''

sqlite3.OperationalError: disk I/O error


d:\folder>

@DoubleLabyrinth
Copy link
Author

DoubleLabyrinth commented Jul 6, 2019

@naveenm0077
You can add python to system variables. Of course, if you don't want to bother to do that, you can specify the full path of python, like

C:\python37-x64\python.exe fix.py

PS: Change C:\python37-x64\python.exe to your python path

@DoubleLabyrinth
Copy link
Author

DoubleLabyrinth commented Jul 6, 2019

@mesteele101
When this happens, it means you run fix.py in Administrator privilege, not SYSTEM privilege which is required when access to %ProgramData%\Microsoft\Windows\AppRepository\StateRepository-Machine.srd.

@naveenm0077
Copy link

naveenm0077 commented Jul 6, 2019

@DoubleLabyrinth It worked! Thank you :)

@mesteele101
Copy link

mesteele101 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

CheonHoPark commented Jul 19, 2019

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

67879017 commented Sep 11, 2019

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

DoubleLabyrinth commented Oct 10, 2019

@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

MeridianGH commented Oct 25, 2019

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

kaizengamer commented Oct 31, 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?

@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

bgiessing commented Oct 19, 2021

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

zuoliang commented Dec 31, 2021

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

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