ScriptTiger / Unified-Hosts-AutoUpdate

Quickly and easily install, uninstall, and set up automatic updates for any of Steven Black's unified hosts files.
https://scripttiger.github.io/more/
MIT License
303 stars 25 forks source link

Windows cannot find '%1=C:\WINDOWS\System32\drivers\etc\hosts'. #61

Open azumukupoe opened 2 years ago

azumukupoe commented 2 years ago

this shows up when trying to open the hosts file but the file "C:\Windows\System32\drivers\etc\hosts" exists

ScriptTiger commented 2 years ago

Just to clarify, you are talking about the final prompt the script gives you after it has finished running and offers to open your hosts file, right?

Does the update process succeed and have you manually opened the hosts file yourself to verify the update was successful? The only issue is just that the script cannot successfully open your hosts file?

Can you replicate the issue and copy and paste all of the output here?

azumukupoe commented 2 years ago
PS C:\ProgramData\chocolatey\lib\unified-hosts-autoupdate\tools\Unified-Hosts-AutoUpdate-master> .\Hosts_Update.cmd
Initializing...
Checking connectivity to raw.githubusercontent.com...                                                                   raw.githubusercontent.com reached successfully                                                                          Your current script version is 1.50                                                                                     Checking for script updates...                                                                                          Your script is up to date
You currently have a scheduled task already in place
Would you like to run the current task now? [Y,N]?Y
Activating update task...
SUCCESS: Attempted to run the scheduled task "Unified Hosts AutoUpdate".
Update task is running...
Update task has completed
Would you like to open your current hosts file before exiting? [Y,N]?Y
File type 'AppX4ztfk9wxr86nxmzzq47px0nh0e58b8fw' not found or no open command associated with it.
The system cannot find the file %1=C:\WINDOWS\System32\drivers\etc\hosts.
Cleaning temporary files...
ScriptTiger commented 2 years ago

Can you confirm you are using Notepad++ as your default text editor? If not, can you tell me what your default text editor is?

Can you also tell me what operating system you are using?

Can you run the following command, then copy and paste the output here? reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice /v PROGID

azumukupoe commented 2 years ago

I do use Notepad++ but it's not set as default

I'm using Windows 11 Pro 22000.469

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice PROGID REG_SZ AppX4ztfk9wxr86nxmzzq47px0nh0e58b8fw

ScriptTiger commented 2 years ago

I'll let this issue sit for a while and see if others have any input.

There are several different ways Windows displays the application name, sometimes just putting the common name, sometimes prepending "Applications\", and sometimes using another unique application identifier, and even the same applications can be presented differently depending on if they were installed through the Microsoft Store, using a downloaded installer, or if they were a downloaded package not requiring installation.

Can anyone confirm that apps on Windows 11 have a standard to start with "App", followed by 33 ASCII characters? If not, what's the new standard? I don't have a Windows 11 to play with at the moment, but I'll definitely revisit this as soon as I do.