Cannot navigate to Windows/System32/drivers/etc
-
It seems like you are using a 32 bit version of Notepad++ on a 64 bit OS. That’s the reason why you can not use the path
C:\Windows\System32\drivers\etc\hosts. Instead you have to useC:\Windows\SysNative\drivers\etc\hosts.Background
Windows 64 bit uses directory and registry virtualization for 32 bit processes. For a 32 bit process
C:\Windows\System32actually points toC:\Windows\SysWOW64whosedriverssubdirectory doesn’t contain anetcdirectory.SysNativeis a folder redirection only working for 32 bit processes which points to theC:\Windows\System32directory.You can read an extensive explanation here.
-
@Lee-Butler I have everything perfectly opened and edited.
C:\Windows\System32\drivers\etc\hosts
Windows 7 х64
-
@andrecool-68 said:
I have everything perfectly opened and edited.
I guess that’s because you are using a 64 bit version of Notepad++.
-
@dinkumoil
It does not matter … I can edit in any text editor x32 or x64
Maybe the whole problem … is he not amine on this computer ?! -
@andrecool-68 said:
It does not matter … I can edit in any text editor x32 or x64
Please note: The problem is not to edit the hosts file by dragging it from an Explorer window to an editor. The issue is about to open the hosts file by using
(menu) File -> Openand selecting it from the Windows file selector dialog. If you do that from a 32 bit process you can navigate toC:\Windows\System32\driversbut you are actually inC:\Windows\SysWOW64\driverswhere you are not able to find anetcdirectory.@andrecool-68 said:
Maybe the whole problem … is he not amine on this computer ?!
Admin or not doesn’t matter, this issue derives from directory redirection for 32 bit processes on 64 bit Windows OS.
Have you read the explanation I’ve already linked to above? This text also contains a link to a Microsoft page where it is explained even in more detail.
-
@dinkumoil
I don’t understand this scam to get toC:\Windows\SysWOW64\driversand edit something … which shouldn’t be edited at all!
Do you want to hack the operating system?
The author… and fools everyone! -
@andrecool-68 said:
I don’t understand this scam to get to
C:\Windows\SysWOW64\driversand edit somethingThere is nothing to edit, that’s the problem.
@andrecool-68 said:
Do you want to hack the operating system?
No, I want to point out a method to navigate to
C:\Windows\System32\drivers\etcfrom within a 32 bit application running on a 64 bit OS to load thehostsfile.I think it would be the best to avoid further comments and to wait for the response of @Lee-Butler.
-
@dinkumoil Don’t wait for anything! All this is a silly idea!
-
I try to provide some possible solutions, as the things I wrote above might not be very helpful.
As this is a complicated topic the truth is somewhere in the middle. As you already became aware of, it is not possible to navigate to
C:\Windows\System32\drivers\etcdirectly by clicking on folder names in Windows file selector dialog because of Windows’ file system redirection for 32 bit processes running on a 64 bit OS. But it is possible to enter the path into the dialog’s address bar and it is possible to enterC:\Windows\System32\drivers\etc\hostsinto itsFilenameinput field. It is also possible to provide this path to Notepad++ per command line. The reason is that file system redirection is not done when the directoryC:\Windows\System32\drivers\etcis explicitly referenced as a whole.Case 1: You want to open the
hostsfile by navigating to its directory using Notepad++(menu) File -> OpenYou have to use the new style FileOpen dialog of Windows. To be able to do that go to
(menu) Settings -> Preferences -> (register) Default Directoryand check optionUse new style dialog. Now go toFile -> Openand enterC:\Windows\System32\drivers\etcto the address bar of the dialog (you can also useC:\Windows\SysNative\drivers\etc). You will see thehostsfile, double-click on it to load it.Case 2: You have Explorer plugin installed and want to use its Favorites feature to create a shortcut to your
hostsfileWhen creating the shortcut provide
C:\Windows\System32\drivers\etc\hostsas path to the file. You can also useC:\Windows\SysNative\drivers\etc\hosts.Case 3: You want a shortcut in the
Runmenu to yourhostsfile in order to avoid installing Explorer pluginClick on
(menu) Settings -> Edit Popup Contextmenuand confirm the dialog box popping up. Right-click on the tab of the file being opened (should becontextMenu.xml) and click onOpen Containing Folder in Explorer. From the Explorer window opened, drag the fileshortcuts.xmlto your Notepad++ window. Locate the XML node<UserDefinedCommands>and add the following line as a child entry to it:<Command name="Open HOSTS file" Ctrl="no" Alt="no" Shift="no" Key="0">$(NPP_DIRECTORY)\notepad++.exe -nosession "C:\Windows\System32\drivers\etc\hosts"</Command>The path also could be
C:\Windows\SysNative\drivers\etc\hosts. Save the file and restart Notepad++. Now you should have an entryOpen HOSTS filein theRunmenu. The file will be loaded if you click on it. -
@dinkumoil I am surprised at your energy)))
-
It’s a question of honour… ;)
-
@dinkumoil Did someone summon you to a duel?
-
No, duels are stupid. No need to be forced by someone. As I said, it’s a question of honour.