Jump to content

Recommended Posts

Posted

Not sure if posting in the right spot for this but ant help would be welcomed.

Came across this as a batch file but don't know what it does, anybody have any ideas?

 

@ECHO OFF

BREAK OFF

Title My Own cmd

color 0a %CMD%

cls echo

goto cmd

:cmd

set /P cmd=command:

Posted

i would guess it creates a command (dos) prompt with your own title (my own cmd) and sets a colour for it.

 

but then its been years since i looked at batch files properly

Posted
Running it twice in a row, it appears to be a little batch file for "setting the default console foreground and background colours"
Posted

Someone's trying to be clever, but failed.

 

It sets the window title to 'My Own cmd'

It sets the text foreground colour to a horrid green.

Clears the screen

prompts the user with 'command:' and waits for them to enter something, then sets the %cmd% variable to the input value.

Then exits, achieving nothing.

 

Here's a fixed script:

 

@ECHO OFF
BREAK OFF
Title My Own cmd
color 0a 
cls
:cmd
set /P cmd=command:
if %cmd%==Q exit
if %cmd%==q exit
start %cmd%
goto cmd

 

I've tidied up the coding errors and added a loop so you can invoke multiple programs or quit (input Q).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...