1

I am running Windows 10.1803, build 17134.320. I am trying to get .asp files to open with VS Code. I went through the normal process, but no matter what, Windows would always ask me what program I wanted to use when I tried to open an ASP file.

So, I looked up the articles, and they said I basically had to edit the Windows registry manually. I can't find the article that I used as a reference, but it was a Microsoft doc. It said to have the file extension link to your program key, and then have your program key have the shell command, like so:

HKEY_CLASSES_ROOT
    .asp
        (Default) - vscode
        OpenWithProgids
            (Default) - (value not set)
            VisualStudio binding
            sublime
    vscode
        DefaultIcon
            (Default) - (value not set)
        shell
            open
                command
                    (Default) - "C:\Users\tschwab\AppData\Local\Programs\Microsoft VS Code\Code.exe" -r "%1"

I did the same thing with .txt files and Sublime (because I had the same problem there), and it worked like a charm. But, for some reason, when I open an ASP file, Windows often edits the registry value for vscode. It becomes:

vscode
    (Default) - URL:vscode
    URL Protocol - 
    DefaultIcon
        (Default) - (value not set)
    shell
        open
            command
                (Default) - "C:\Users\tschwab\AppData\Local\Programs\Microsoft VS Code\Code.exe" --open-url -- "%1"

So, three changes. The default value of the root is added, a value of "Url Protocol" is added, and the command is modified. After this, opening a file in Windows explorer no longer works. If I edit the command back, it works again.

So, what is going wrong?

2

Found the solution here. I had created the custom registry key vscode, but Electron was editing it behind VS Code's back. I didn't notice that a key already existed named VSCodeSourceFile that was precisely what I needed. I remapped the .asp binding from vscode to VSCodeSourceFile, and this worked.

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.