badders Posted June 13, 2007 Posted June 13, 2007 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:
MK-2 Posted June 13, 2007 Posted June 13, 2007 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
Jake Posted June 13, 2007 Posted June 13, 2007 Running it twice in a row, it appears to be a little batch file for "setting the default console foreground and background colours"
Geoff Posted June 13, 2007 Posted June 13, 2007 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).
mattx Posted June 13, 2007 Posted June 13, 2007 Are you going to charge £8 for that script Geoff ? [ See - http://www.edugeek.net/index.php?name=Forums&file=viewtopic&t=9336&highlight=netsh ]
badders Posted June 13, 2007 Author Posted June 13, 2007 Thanks. Got to work out how to stop the kids from doing this now!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now