0

When I open a .zip file in Windows 10, and view it in its Compressed Folder Tools, I can open text files, Windows documents, etc. But for executable text files, like .bat or .js, the open option tries to execute the file, rather than opening it in an editor.

If it were not a compressed folder, the context menu would give me an edit option, but in Compressed Folder Tools, I do not have that option in the menu.

Is there some way of opening up these files in a text viewer or text editor, rather than executing them, without the bother of extracting them to a non-compressed folder?

0

It is possible to alter the default action for double clicking (see the answer by w32sh) but if you don't want that, the following may help you:

There are various archivers who will give you the option to view or edit any file inside the archive, such as WinRAR.

Alternatively, learn to always unzip to a folder and open the folder to access the files.

  • So, my choice is either to wait for MS to write a decent zip tool, or find a third-party tool. Anyone want to lay odds on how long it takes MS to figure out that they're doing it wrong? – Jeff Dege Mar 1 '16 at 17:38
1

Double-clicking a file from Compressed Folder works the same way as you double-click a file in File Explorer. It simply uses your file association settings. To set .BAT file default action to "Edit", you need to change the registry setting here:

HKEY_CLASSES_ROOT\batfile\shell

Start Regedit.exe and go to the above location

Double-click (default) and set its value data as edit

Double-clicking Bat files will now open the editor (Notepad, which is the default editor.)

Likewise for other file types, say .JS:

HKEY_CLASSES_ROOT\JSFile\Shell

  • That may be where the problem is. I don't ever want a .js file to execute, just because I double clicked on it, but I do want a .bat file to execute, when I click on it in a real folder, but I do not, when I click on a .bat in a .zip. More than that, though, I want to be able to choose which action I want to take, instead of being forced to the default. – Jeff Dege Mar 1 '16 at 17:37
  • Two different double-click actions, one for File Explorer and another for Compressed Folder container... I'm afraid that's not possible. – w32sh Mar 1 '16 at 18:04
  • Certainly it's possible, But it would require MS to recognize that they're doing things wrong and to change their code. – Jeff Dege Mar 1 '16 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.