Half-arsed batch file replacement

What I’m basically using FB for is to replace a series of batch files. It occurs to me that a nice way of stepping into this quagmire would be to be able to paste batch files (or any other line-by-line scripting language…?) directly into FB. I understand that it can run whole .bat files by setting cmd.exe on them. But how about either:

1) A “Run batch file” action that lets you enter multiple lines of batch code, then run it with the interpreter of your choice (cmd.exe, powershell.exe, command.com for nostalgics…)

2) Some kind of batch file converter that turns each line of a batch file into an action. Any line it doesn’t recognise it would send to cmd.exe to deal with. But you could add a lot of sophistication, like recognising GOTOs, REMs etc. I guess you would need some pretty smart wrappering code to maintain state, like variables and so forth.


I guess it’s sort of nice being able to “script” in JScript or VBScript, but for a lot of Windows developers, the natural “scripting” language is still .BAT files, and there doesn’t seem to be a lot of support for that?

Steve

Hi Steve,

These are both good ideas (with the minor quibble that GOTO structure don’t translate very well into FB’s action hierarchy. I’ve put them on our to-do list.

- Angus

Posted By Steve Bennett on 16 Nov 2006 5:55 PM
What I'm basically using FB for is to replace a series of batch files. It occurs to me that a nice way of stepping into this quagmire would be to be able to paste batch files (or any other line-by-line scripting language...?) directly into FB. I understand that it can run whole .bat files by setting cmd.exe on them. But how about either:

1) A "Run batch file" action that lets you enter multiple lines of batch code, then run it with the interpreter of your choice (cmd.exe, powershell.exe, command.com for nostalgics...)

Good call. I was just thinking of requesting a similiar feature. I'm getting good at cramming a bunch of commands on to one line - using pipes, ampersands, tricks with the FOR command, etc - but there is limits to that and it's really hard to edit a command like that.

I've thought about having external .bat files that I call, but that just seems too messy. And if you're checking your FBP4 files into source control, then you always have to worry about your .bat file and .fbp4 file being the same version when you do a "get" from source control.

I think being able to paste the contents of a batch file into a FinalBuilder action is a great idea.