Windows Paths and file associations via cmd ##################################### Just a note to self on viewing PATHs and PATHEXT in windows (and an explanation of each if your not familiar with it). Also a look at how associations of filetypes are done with command line with Windows. All of this inferred from:  http://www.techotopia.com/index.php/Simple_Ruby_Examples COMPLETE SIDENOTE: I start my windows commands with > and my linux commands usually with # (unless im showing a script, in which case I omit the # – unless of course there is a comment then I do have the # as that is the bash # comment symbol)   PATH & PATHEXT ############### PATH: what folders to look for executables thru PATHEXT: what file extensions win thinks are executable To view:

Or use: eveeditorfree Example:

 

Setting the path (its best to set it up front)   To set .rb as an extension that is executable

That will change my PATHEXT to this

To set c:\Ruby\bin\ as a folder to look through for running executables (When typing commands in cmd):

That will set it to this:

ASSOC and FTYPE ################ ftype: ftypes (or filetypes) are associated to the commandline of running the app with its associated files. assoc: associate extensions to filetypes (which associates them to the command line) For example using assoc you can associate .txt files to a ftype called notepad.txt (or anything, with or without a dot).

The syntax is: assoc .extension=ftype so in this case .extension is .txt and ftype is notepad.txt Now we can associate notepad.txt (this looks like a filename dont confuse this for a filename this is just an ftype) which is an ftype to running a program notepad.exe

That means that any file that has the extension .txt, when clicked upon will run the following program (imagine a file called story.txt that you just double clicked on) c:\programs\notepad.exe story.txt To print all of the systems ftypes

To print all of the assoc

NOTE: assoc and ftypes work together hand in hand

One thought on “Windows PATH & PATHEXT and file associations via cmd FTYPE & ASSOC

Leave a Reply

Your email address will not be published. Required fields are marked *