Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a scripting language that 'compiles' to windows batch syntax?

Is there a language, similar to what CoffeeScript is to JavaScript, that compiles to the language of the windows batch|cmd|command line?

The cmd versions I refer to are the ones based on NT, especially XP sp3 and up.

like image 821
n611x007 Avatar asked Nov 04 '12 21:11

n611x007


3 Answers

Yes there is one language called Batsh, which compiles to both Bash and Windows Batch.

Project: https://github.com/BYVoid/Batsh

Online demo: http://batsh.byvoid.com/

like image 83
BYVoid Avatar answered Oct 13 '22 03:10

BYVoid


As far as I know, what you're asking for doesn't exist, although it would be possible to create such a language, and it would be an intersting exercise.

The alternative is other languages that are also "built-in" to the OS.

Others have mentioned PowerShell, which is very powerful, and is built in, I think, in Win7 and up.

The other alternative is the Windows Script Host for which you can write scripts in VBScript and/or Javascript. It's built-in to WinXP and up.

like image 42
Andrew Cooper Avatar answered Oct 13 '22 04:10

Andrew Cooper


Just for your edification, CoffeeScript is a domain specific language built on JavaScript, so you could in theory intermingle the two. I am not aware of such a language for batch files. The windows powershell might be worth a look see.

like image 24
cowboydan Avatar answered Oct 13 '22 04:10

cowboydan