Cannot navigate to Windows/System32/drivers/etc



  • @Lee-Butler I have everything perfectly opened and edited.
    C:\Windows\System32\drivers\etc\hosts
    Windows 7 х64

    Imgur



  • @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 -> Open and selecting it from the Windows file selector dialog. If you do that from a 32 bit process you can navigate to C:\Windows\System32\drivers but you are actually in C:\Windows\SysWOW64\drivers where you are not able to find an etc directory.

    @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 to C:\Windows\SysWOW64\drivers and 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\drivers and edit something

    There 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\etc from within a 32 bit application running on a 64 bit OS to load the hosts file.

    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!



  • @Lee-Butler

    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\etc directly 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 enter C:\Windows\System32\drivers\etc\hosts into its Filename input 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 directory C:\Windows\System32\drivers\etc is explicitly referenced as a whole.

    Case 1: You want to open the hosts file by navigating to its directory using Notepad++ (menu) File -> Open

    You have to use the new style FileOpen dialog of Windows. To be able to do that go to (menu) Settings -> Preferences -> (register) Default Directory and check option Use new style dialog. Now go to File -> Open and enter C:\Windows\System32\drivers\etc to the address bar of the dialog (you can also use C:\Windows\SysNative\drivers\etc). You will see the hosts file, 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 hosts file

    When creating the shortcut provide C:\Windows\System32\drivers\etc\hosts as path to the file. You can also use C:\Windows\SysNative\drivers\etc\hosts.

    Case 3: You want a shortcut in the Run menu to your hosts file in order to avoid installing Explorer plugin

    Click on (menu) Settings -> Edit Popup Contextmenu and confirm the dialog box popping up. Right-click on the tab of the file being opened (should be contextMenu.xml) and click on Open Containing Folder in Explorer. From the Explorer window opened, drag the file shortcuts.xml to 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 entry Open HOSTS file in the Run menu. The file will be loaded if you click on it.



  • @dinkumoil I am surprised at your energy)))



  • @andrecool-68

    It’s a question of honour… ;)



  • @dinkumoil Did someone summon you to a duel?



  • @andrecool-68

    No, duels are stupid. No need to be forced by someone. As I said, it’s a question of honour.


Log in to reply