Can I use Sass with a batch script in Windows

Put your original two commands into your batch file. So the content of the .bat file would be:

cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title"
sass --watch scss/style.scss:css/style.css

Simple as that. A batch file like this runs each command on each line one after the other, as if you were typing each one individually.


If you're trying to update multiple css files with a batch file like this:

scss A.scss ../CSS/A.css
scss B.scss ../CSS/B.css
echo Done.

...but only the first scss command line executes, and the batch file never completes, i.e. you never see the 'Done.', here is why and how to fix it:

scss is actually a buggy batch file that fails to return control to your batch file. I fixed this by bypassing the scss batch file and runing ruby and it's scss gem directly as follows:

ruby C:/Ruby193/bin/scss A.scss ../CSS/A.css
ruby C:/Ruby193/bin/scss B.scss ../CSS/B.css
echo Done.

You'll need to have your path pointed to ruby, or put an absolute path in above.