0

I am using a batch file to run Grunt with some console customization. I was wondering if there is a way to add grunt and a space to the commands I enter into the console.

Here is my batch file:

CD /D "C:\Users\ACCRS\Documents\Grunt"
START cmd /K "grunt & title Grunt & prompt $"

It would be good if I could make it so it only add grunt if the command is not recognized without it.

Marcel
  • 288
  • Are you saying you want Grunt to be part of the interactive command line so that if you issue a command in that window that doesn't have a corresponding way to run, it will try it as if you'd typed grunt first? – Mark Allen Aug 20 '14 at 19:21
  • @MarkAllen That's the way I read it. The tricky bit being particularly that Grunt should only be used when the normal options fail. So, for dir CMD would just process dir. But for gruntcommand, where it's not a built-in command and isn't a EXE/COM/BAT/etc in %PATH%, CMD should automatically prepend grunt and then process the whole thing as grunt gruntcommand. – Iszi Aug 20 '14 at 19:59
  • Exactly! Is that even possible? – Marcel Aug 20 '14 at 20:46
  • Kinda? Take a look at the Doskey command (still present in Windows 8.1 regardless of what the link name says) http://superuser.com/questions/49170/create-an-alias-in-windows-xp

    You could try to make aliases for at least all the common grunt commands, I think. Give it a shot!

    – Mark Allen Aug 20 '14 at 21:55
  • I have Windows 7 D: – Marcel Aug 21 '14 at 00:50
  • Awesome - it's not exactly what you wanted but it's close at least. – Mark Allen Sep 02 '14 at 19:45
  • Yeah it works for me. – Marcel Sep 02 '14 at 20:19

0 Answers0