Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the default app for .ts files to Visual Studio Code?

I have a PC running Windows 10 Pro for Workstations, and currently Typescript files (extension .ts) open with Films & TV. I have gone into Settings > Choose default apps by file type, and change it to Visual Studio Code, but it does not change it. So far I have uninstalled Films & TV and switched off Windows Media Player but it still will not save my choice of default. I have also tried this: navigate to a .ts file. Right click & select open with. Tick the box - Always use this app to open .ts files. Select Visual Studio Code & OK. It still does not change.

like image 362
Steve Staple Avatar asked Jan 04 '19 11:01

Steve Staple


People also ask

How do I change my default editor to Vscode?

First find the file type for which would like to have Visual Studio Code be your default editor. You can right click on it and select “Choose default program…”. Or you can select “Properties” and click the “Change…” button.


2 Answers

You can change register values under Computer\HKEY_CLASSES_ROOT.ts register entry into following:

ContentType text/plain
PerceivedType text

Then, system will allow you to change associated application as in other popular use cases (i.e. right click > properties > change...)

like image 129
Tomas Avatar answered Oct 08 '22 21:10

Tomas


I ended up removing the Computer\HKEY_CLASSES_ROOT.ts key in regedit, then opening a .ts file with the "Open with ..." option. After that was able to open .ts files with my choosen program.

like image 29
Menno van der Leden Avatar answered Oct 08 '22 21:10

Menno van der Leden