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

Viewed 2307

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.

4 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...)

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.

Right click -> Properties -> Change button in "Opens With" -> select Visual Studio or VS Code.

Click on OK. It should make the default program for TS extension.

I had the same issue, I fixed it by,

Right Clicking a .ts file -> Hover over Open With -> Click Choose Another App -> Tick the Always use this app to open .ts files -> Select VsCode from the list of apps -> Click Ok.

Related