0

I created a batch file (with external 3d party commands compiled with it into an .exe) that allows for the use of multiple colors in a single screen.

Here's a link to check it out.

Here's a screenshot: As I said.

Anyway, I don't like it. It needs two variable to work. You have to set the variables %color1% and %color2% to some HEX values, the standard colors (with BG before FG). Then you just run the command kick. Everything after that will appear in those two specified colors.

I don't like having to set variables before running the file. Its a pain.

I figured out a work-around.

set color1=0 & set color2=f & kick

I can use that, no problem (just replace 0 and f with whatever colors I wan't), but I would much rather have it work by:

kick /c 0 f

Where the /c switch specifies which colors are to set as the variables color1 and color2`. So if anybody can help me develop this, that would be awesome.

So my question is, how do you turn a batch file into a command line tool?

I don't expect anybody to type a whole guide up, but if you have a link to an article, please share.

2 Answers2

1

You may do that in a two-step process:

  • Rename kick.exe file to kick0.exe one. You need to locate where the kick.exe file is in order to do this rename.
  • Create a Batch file called kick.bat in the same folder with these lines:

.

@echo off
set color1=%2
set color2=%3
kick0

After that, you may enter kick /c 0 f from the command-line, or call kick /c 0 f from a Batch file.

Aacini
  • 65,180
  • 12
  • 72
  • 108
0

A command-line tool?

Do you mean something like KiXtart or AutoIt? AdminscriptEditor (although no longer in business) was also based out of the need for using command-line tools.

It really boils down to necessity is mother of invention.

Ruud van Velsen, an employee of Microsoft developed (and continues) to develop KiXtart.. It was based out of the need of not having a ton of third-party apps. However, Since the Windows 2000 Resource Kit Release, it has taken a back-seat to VBS, PowerShell and other tools that have come in favor over the past few years.

Back to your point, Rob van der Woude's scripting site has quite a bit of stuff as does ss64..

http://www.robvanderwoude.com/

http://ss64.com

Ss64 is good as it has not only command-line, Resouce Kit, as well as Bash tools.

Leptonator
  • 3,379
  • 2
  • 38
  • 51
  • I just want to be able to type `kick /c 0 f` and for it to work. –  Jul 13 '14 at 21:41
  • Look for ARGS.. ARGS are what are used by Batch scripts.. For example - http://ss64.com/nt/syntax-args.html – Leptonator Jul 13 '14 at 21:43
  • Go here - http://stackoverflow.com/questions/26551/how-to-pass-command-line-parameters-in-batch-file And here is a "real life example: - http://www.dostips.com/DtTutoFunctions.php#FunctionTutorial.PassingFunctionArguments – Leptonator Jul 13 '14 at 21:47
  • You could also use [colorx.exe](http://www.westmesatech.com/sst.html) freeware tool I wrote a while back which already does this. PowerShell can also do it. – Bill_Stewart Jul 13 '14 at 22:33