Associating Files From Command Line In Windows

Stuck in Windows (have only tested it on an XP Virtual machine) and need to do development work, but constantly have to associate files (.php, .pl, .htaccess, .css, …) as Windows doesn’t support them by default?

Write a script on your webserver to get a list of all the extensions being used and write a bash script in Windows to associate them all with whichever program you need it associated with (Post a comment if you need help).

How do you associate files via command line?

Type: assoc <.extension>=<filetype>

assoc-command

Let’s say you need to add new types or want to change the program being used to open txtfiles or phpfiles or whatever filetype you want to reassign to a different program.

In Windows Explorer go to Tools -> Folder Options -> File Types

folder_options

Here you can reassociate the txtfile or any other file type with whatever program you want and add other file types.

Hope this saves a couple of Windows victims a bit of time ;-)



Share this entry:

  • Facebook
  • LinkedIn
  • Twitter
  • muti
  • Google Bookmarks
  • Ping.fm
  • HelloTxt
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon

Related Posts

Tags: , ,

5 Responses to “Associating Files From Command Line In Windows”

  1. Arné says:

    Very cool, never to learn new tricks ;-)

  2. Arné says:

    “TOO OLD”

  3. Re@PeR says:

    Haha, now that makes more sense :p

    It seems Windows has an undiscovered world of scripting capabilities that just never gets any attention; although it’s far from being as powerful as Linux, at least there’s something to use when needing to automate tasks :-)

  4. Pyro says:

    Hehe, it’s not a BASH script you linux addict ;)

    Powershell should go a long way towards proper scripts in windows environments, but even the humble little command line can get a lot of work done.

    You just gotta learn the words!

  5. Re@PeR says:

    Woops, I probably meant batch script or what do you call those things again :p

    That’s a great tip Pyro, never even knew about PowerShell, just had a quick look on Wikipedia and it does look very handy: http://en.wikipedia.org/wiki/Windows_PowerShell

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Syndication

Enter your email address

広告