Question

I'm on Windows 7, and I use a simple local build process that involves running node with Twitter RECESS and less.js to compile LESS to css on the fly.

Typically I just open cmd and type: lessc --compile stylesheet.less > stylesheet.css and it compiles the css no problem. Sometimes I use recess --compile, and sometimes I do --watch, but it works pretty much the same. I've been doing variations of this for months without a problem.

Today, something I did caused cmd to start opening the program associated with .less files every time a run a command. So when I type lessc --compile stylesheet.less > stylesheet.css it doesn't compile the .css file, it opens Sublime Text. I know nothing about Windows command prompts, and although I've spent the last two hours searching for an answer to this on google and SO, I'm not even sure I even know the correct terms to search for the right answer.

EDIT: I tried first removing any association with .js files, and that didn't work. Windows Automatically associated .js files with Visual Studio and wouldn't allow me to choose no program at all, even through command prompt. Then I tried changing the default program for .js files from to Notepad just for the heck of it, and now Notepad opens when I run a command. So at least it fails faster, but it still fails.

In any case, file association isn't the problem, I (anyone) should be able to use cmd with node regardless of whatever file associations exist - because, after all you need both node and your file associations to work properly. To me it seems like Windows is simply ignoring node.js now. I've even tried reinstalling it to see if that works.

Thanks for

OTHER TIPS

Try the assoc command to check the file association and disassociate if necessary. Use assoc /? to see the usage.

assoc .less=

will disassociate.

Either that or you have changed the binary (or added another binary with the same name earlier in the PATH) that now launches the GUI program.

Look at the commands ftype and assoc.

In this case, I think you want assoc <.yourfileext>=

which removes any association between the file extension .yourfileext and any associated program. Make sure you check first before you remove so you know how to put the association back if there is a mistake.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top