+ Post New Thread
Results 1 to 9 of 9
Scripts Thread, What does this do? in Coding and Web Development; Not sure if posting in the right spot for this but ant help would be welcomed. Came across this as ...
  1. #1
    badders's Avatar
    Join Date
    Apr 2007
    Location
    Cumbria
    Posts
    136
    Thank Post
    37
    Thanked 9 Times in 8 Posts
    Rep Power
    17

    What does this do?

    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:

  2. IDG Tech News

  3. #2

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Blog Entries
    8
    Thank Post
    149
    Thanked 580 Times in 307 Posts
    Rep Power
    194

    Re: What does this do?

    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

  4. #3

    Join Date
    Nov 2006
    Posts
    551
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: What does this do?

    not alot

  5. #4
    Jake's Avatar
    Join Date
    Jan 2006
    Location
    Sunny South Coast
    Posts
    952
    Thank Post
    11
    Thanked 12 Times in 10 Posts
    Rep Power
    16

    Re: What does this do?

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

  6. #5
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,056
    Blog Entries
    1
    Thank Post
    104
    Thanked 439 Times in 380 Posts
    Rep Power
    114

    Re: What does this do?

    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:

    Code:
    @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).

  7. #6
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,430
    Thank Post
    79
    Thanked 90 Times in 86 Posts
    Rep Power
    32

    Re: What does this do?

    Quote Originally Posted by Geoff
    Someone's trying to be clever, but failed.

  8. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    8,472
    Thank Post
    889
    Thanked 890 Times in 532 Posts
    Rep Power
    596

    Re: What does this do?

    Are you going to charge £8 for that script Geoff ?
    [ See - http://www.edugeek.net/index.php?nam...ighlight=netsh ]

  9. #8
    badders's Avatar
    Join Date
    Apr 2007
    Location
    Cumbria
    Posts
    136
    Thank Post
    37
    Thanked 9 Times in 8 Posts
    Rep Power
    17

    Re: What does this do?

    Thanks. Got to work out how to stop the kids from doing this now!

  10. #9
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,056
    Blog Entries
    1
    Thank Post
    104
    Thanked 439 Times in 380 Posts
    Rep Power
    114

    Re: What does this do?

    Use a file restriction policy.

SHARE:
+ Post New Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •