Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assoc and ftype do not work under Powershell

Tags:

powershell

I thought all cmd commands work the same under Powershell. For example assoc and ftype do not work. Is there a way to make them work instead of switching to cmd again?

like image 291
user310291 Avatar asked Nov 06 '15 17:11

user310291


2 Answers

Oh, they'll work, but you have to call them through cmd.exe as they're not actual programs that reside on disk, but functionality built-in to cmd.exe like so:

cmd /c assoc
cmd /c ftype

like image 162
Eric Walker Avatar answered Sep 30 '22 20:09

Eric Walker


Expanding on Eric's answer, here's how to make assoc and ftype "just work" in powershell.

Add this to your powershell profile -- you can just run $Profile in powershell to find your profile file:

function assoc { cmd /c assoc $args }
function ftype { cmd /c ftype $args }
like image 30
Carl Walsh Avatar answered Sep 30 '22 21:09

Carl Walsh