+ 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
    170
    Thank Post
    44
    Thanked 11 Times in 10 Posts
    Rep Power
    21

    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. #2

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

    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

  3. #3

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

    Re: What does this do?

    not alot

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

    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"

  5. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    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).

  6. #6
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    41

    Re: What does this do?

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

  7. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740

    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 ]

  8. #8
    badders's Avatar
    Join Date
    Apr 2007
    Location
    Cumbria
    Posts
    170
    Thank Post
    44
    Thanked 11 Times in 10 Posts
    Rep Power
    21

    Re: What does this do?

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

  9. #9

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    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
  •