Search code examples
drag-and-dropvisual-studio-code

Is drag-and-drop to open a file possible in VSCode?


I am wondering if something is wrong with my computer (or myself), because I can't seem to drag & drop a file into Visual Studio Code to open it in the editor. Closing an opened folder first doesn't make a difference. VSCode always shows me the 'stop sign', in every spot I tried (the editor, the opened tab bar, an existing opened file, ...).

Why does VSCode block this ?

(I have experienced this in earlier versions as well. Currently on v1.6 on Windows 7.)


Solution

  • Searching for a solution, I stumbled on this page, where one commenter explains:

    I think you are running into the security issue where lower permission processes cannot send messages to higher permission processes. Explorere.exe, running at normal permission levels, cannot send the window message to winword.exe, running elevated.

    I am indeed always running VSCode as Administrator, but not my Explorer windows.

    When I run VSCode in non-administrator mode (so just my regular user), drag-and-drop works fine.