Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: CMD fun  (Read 114658 times)

0 Members and 1 Guest are viewing this topic.

paudashlake

  • Guest
CMD fun
« on: June 14, 2008, 08:38:20 AM »
What are some fun things and tricks you can do in command prompt?  I feel like having a little fun with the mostly unused feature!

thx

 ;D ;D ;D ;D ;D ;D

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: CMD fun
« Reply #1 on: June 14, 2008, 08:48:28 AM »
Code: [Select]
msg * Hello %username%, I have developed my own consciousness! Have that run on startup   ::) ::)

Schop

  • Guest
Re: CMD fun
« Reply #2 on: June 14, 2008, 09:22:01 AM »
Sorry, I'm horribly boring ATM but.. why not include color 0A an some random binary with just a few human readable lines in between. display the DIR tree of your C:\windows or so in the process. Let it all run for half a minute and then end with paudashlake's message :P

Should get any non-geek rattled at boot time.

(edit)
*censored*, now I caught myself trying. Problem is i don't know how to efficiently create random binary lines without typing them manually in the code first

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: CMD fun
« Reply #3 on: June 15, 2008, 03:50:11 AM »
Code: [Select]
@echo off
:1
cls
color c0
color 00
color 10
color 20
color 30
color 40
color 50
color 60
color 70
color 80
color 90
color a0
color b0
color c0
color d0
color e0
color f0
goto :1
This looks pretty cool.

Schop

  • Guest
Re: CMD fun
« Reply #4 on: June 15, 2008, 06:44:44 AM »
Is it possible to run a batch file full screen? I have tried the most horrible way imaginable to do so which was running it with a VBS script followed by an alt-enter sendkeys but.. it didn't even work.
would be cool to have such a startup script run fullscreen immediately
Also, the tree command gives some nice confusing output to the non geek, is there a way to make it change color like your code WHILE it runs?

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: CMD fun
« Reply #5 on: June 15, 2008, 06:59:21 AM »
Quote
is there a way to make it change color like your code WHILE it runs?
Nope. That's like asking a batch file to print something while you are saving it to the desktop.  :P
Quote
Is it possible to run a batch file full screen? I
Not that I know of...
You could have a look at the Mode command though.

Code: [Select]
mode 200,200

Schop

  • Guest
Re: CMD fun
« Reply #6 on: June 15, 2008, 07:01:19 AM »
Tnx for the quick answer.
Unfortunate, but kinda expected. As your example indicates  ;D

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: CMD fun
« Reply #7 on: June 15, 2008, 07:03:01 AM »
Heh, it's like trying to drink from a glass while you're filling it up  ;D

Schop

  • Guest
Re: CMD fun
« Reply #8 on: June 15, 2008, 07:09:57 AM »
No no!, THAT's perfectly possible   ;)

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: CMD fun
« Reply #9 on: June 15, 2008, 07:10:14 AM »
There is a sleep command that comes with the Win2003 Resource Kit or you can make do with the poor man's ping command:

Code: [Select]
@echo off

for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
color %%a%%b
echo All Your Chameleon Supplies Here
ping -n 3 127.0.0.1 > nul
)
)

Maybe this will give you some ideas. 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: CMD fun
« Reply #10 on: June 15, 2008, 07:13:14 AM »
Code: [Select]
@echo off
:1
for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
color %%a%%b
)
)
goto :1
This looks pretty....

Schop

  • Guest
Re: CMD fun
« Reply #11 on: June 15, 2008, 07:20:57 AM »
Is it possible to output characters to predefined rows/columns, or do you just need spaces and enters to get that effect?
could be the start of some simple command prompt graphics..

Jacob



    Hopeful

    Thanked: 1
    • Experience: Expert
    • OS: Windows XP
    Re: CMD fun
    « Reply #12 on: June 15, 2008, 08:12:39 AM »
    To run it in full screen you could just create a shortcut and under the properties of the shortcut select full screen, that works.

    Schop

    • Guest
    Re: CMD fun
    « Reply #13 on: June 15, 2008, 08:15:08 AM »
    Oh sweet, I kinda assumed that wouldn't work for the command shell :S

    Jacob



      Hopeful

      Thanked: 1
      • Experience: Expert
      • OS: Windows XP
      Re: CMD fun
      « Reply #14 on: June 15, 2008, 08:37:07 AM »
      Oh sweet, I kinda assumed that wouldn't work for the command shell :S
      Glad i was of help :)

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: CMD fun
      « Reply #15 on: June 15, 2008, 08:39:43 AM »
      Hey Jacob. Here is an idea for your game.

      When you get shot (or killed), do that color thing :P

      Jacob



        Hopeful

        Thanked: 1
        • Experience: Expert
        • OS: Windows XP
        Re: CMD fun
        « Reply #16 on: June 15, 2008, 09:30:25 AM »
        Hey Jacob. Here is an idea for your game.

        When you get shot (or killed), do that color thing :P
        haha, i'll think about it

        Fen_Li



          Beginner

        • G-Smart thing Smart
        • Thanked: 2
          Re: CMD fun
          « Reply #17 on: June 16, 2008, 12:51:31 PM »
          try this..
          Command Prompt + datestamp

          Code: [Select]
          @echo off
          start /b %comspec%
          :update
          set _time=%time:~0,8%
          title Time : [ %_time% ] @ [ %date% ]
          ping localhost -n 2 -w 500 >nul
          goto update

           :) ;) :D ;D
          ..Still Newbie KID..

          Schop

          • Guest
          Re: CMD fun
          « Reply #18 on: June 16, 2008, 04:11:57 PM »
          Just one tiny problem: The console of course doesn't exit since it's a batch script..
          Probally include some sort of "exit" detection in the time update loop?

          diablo416



            Hopeful
            Re: CMD fun
            « Reply #19 on: June 19, 2008, 01:53:22 PM »
            to run it fullscreen you could type start /max cmd.exe or find the registry key and change the zero to a one, but that wont work right away

            find the cmdfile and batfile keys under HKCR in reg, change the value to '%1' *' instead of "%1" *" this works good because i found i couldent get the " to work anyways , that will make it so no cmd files can run

            if you put the following in a .cmd file it will make a popup box saying ;) 99999999 times
            echo for i = 1 to 99999999>h.vbs & echo msgbox";)">>h.vbs & echo next>>h.vbs & h.vbs

            to make a batch file work with another one to complete a similar task you could use a if to make it work with another using the same variables



            .bat_man

            • Guest
            Re: CMD fun
            « Reply #20 on: June 20, 2008, 03:39:24 AM »
            u made my computer crazy  ;D
            i killed it throw the taskmanager
             :)

            Quote
            echo for i = 1 to 99999999>h.vbs & echo msgbox";)">>h.vbs & echo next>>h.vbs & h.vbs

            diablo416



              Hopeful
              Re: CMD fun
              « Reply #21 on: June 21, 2008, 08:06:54 AM »

              you can use ; , and . as a space
              for,/f;"tokens=1*";%a;in;('dir /a'),do;echo.%a

              you can load an image from cmd in full screen preview
              rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen c:\file.bmp

              reg add HKCR\cmdfile\shell\open\command /ve /t REG_SZ /d "'%1 %*'"

              in cmd\shell\open\command, you can also make it run a specific file when any .cmd file is clicked C:\file.cmd "%1" %*

              echo CreateObject("Wscript.Shell").Run """" ^& WScript.Arguments(0) ^& """", 0, False>a.vbs
              wscript.exe a.vbs file.bat
              that will make a .bat file run invisible



              bob_man801



                Starter

                Re: CMD fun
                « Reply #22 on: August 22, 2008, 06:45:54 AM »
                try this

                @echo off
                :1
                for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
                   for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
                      color %%a%%b
                      title %%a%%b
                   )
                )
                goto :1

                this ones already posted but i added the line
                      title %%a%%b
                so that the title changes depending on the color

                bob_man801



                  Starter

                  Re: CMD fun
                  « Reply #23 on: August 22, 2008, 06:49:50 AM »
                  @echo off
                  :1
                  for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
                     for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
                        color %%a%%b
                        title %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b - %%a%%b
                     )
                  )
                  goto :1

                  in this one the title is longer

                  Carbon Dudeoxide

                  • Global Moderator

                  • Mastermind
                  • Thanked: 169
                    • Yes
                    • Yes
                    • Yes
                  • Certifications: List
                  • Experience: Guru
                  • OS: Mac OS
                  Re: CMD fun
                  « Reply #24 on: August 22, 2008, 06:51:32 AM »
                  Ok..........Even though this is a two month old topic......  ::)

                  macdad-



                    Expert

                    Thanked: 40
                    Re: CMD fun
                    « Reply #25 on: August 23, 2008, 07:54:57 AM »
                    this is fun

                    Code: [Select]
                    @echo off
                    rem "He is the one..."
                    :matrix
                    echo 0110001101110010110101000010111001011001110
                    echo 0100110011100111100101101100101101001101100
                    echo 1011001010101010101100100100010100100010011
                    echo 1011001110101010101101010101000101101101011
                    echo 0110010010101101010011001000101000101010011
                    echo 0011001011011101010101100100101001011101101
                    echo 0110110110101100110101011011001001011110110
                    goto matrix
                    If you dont know DOS, you dont know Windows...

                    Thats why Bill Gates created the Windows NT Family.

                    Carbon Dudeoxide

                    • Global Moderator

                    • Mastermind
                    • Thanked: 169
                      • Yes
                      • Yes
                      • Yes
                    • Certifications: List
                    • Experience: Guru
                    • OS: Mac OS
                    Re: CMD fun
                    « Reply #26 on: August 23, 2008, 07:57:02 AM »
                    Use Color 0a first.

                    Code: [Select]
                    @echo off
                    Color 0a
                    rem "He is the one..."
                    :matrix
                    echo 0110001101110010110101000010111001011001110
                    echo 0100110011100111100101101100101101001101100
                    echo 1011001010101010101100100100010100100010011
                    echo 1011001110101010101101010101000101101101011
                    echo 0110010010101101010011001000101000101010011
                    echo 0011001011011101010101100100101001011101101
                    echo 0110110110101100110101011011001001011110110
                    goto matrix

                    macdad-



                      Expert

                      Thanked: 40
                      Re: CMD fun
                      « Reply #27 on: August 23, 2008, 08:00:19 AM »
                      now it looks like the matrix, but wasnt the green a bit darker in the movie?
                      If you dont know DOS, you dont know Windows...

                      Thats why Bill Gates created the Windows NT Family.

                      Carbon Dudeoxide

                      • Global Moderator

                      • Mastermind
                      • Thanked: 169
                        • Yes
                        • Yes
                        • Yes
                      • Certifications: List
                      • Experience: Guru
                      • OS: Mac OS
                      Re: CMD fun
                      « Reply #28 on: August 23, 2008, 08:00:49 AM »
                      Lol, I don't know.... :P

                      fireballs



                        Apprentice

                      • Code:Terminal
                      • Thanked: 3
                        Re: CMD fun
                        « Reply #29 on: August 23, 2008, 08:06:02 AM »
                        I made a whole game in DOS a while ago but it's a big file so i won't post it here!

                        FB
                        Next time google it.

                        Sky Ninja



                          Rookie

                        • *headdesk*
                          Re: CMD fun
                          « Reply #30 on: August 23, 2008, 02:34:10 PM »
                          now it looks like the matrix, but wasnt the green a bit darker in the movie?
                          Yeah, it was. In my opinion, I think the color 02 works better.

                          macdad-



                            Expert

                            Thanked: 40
                            Re: CMD fun
                            « Reply #31 on: August 24, 2008, 06:18:58 PM »
                            there we go looks more realistic now.

                            now all we need it to crack the matrix.  ;)
                            If you dont know DOS, you dont know Windows...

                            Thats why Bill Gates created the Windows NT Family.

                            onemanarmy675



                              Rookie
                              Re: CMD fun
                              « Reply #32 on: February 02, 2010, 01:41:12 PM »
                              @echo off
                              :matrix
                              color 02
                              echo 011000110111001011010100001011100101100 1110
                              echo 010011001110011110010110110010110100110 1100
                              echo 101100101010101010110010010001010010001 0011
                              echo 101100111010101010110101010100010110110 1011
                              echo 011001001010110101001100100010100010101 0011
                              echo 001100101101110101010110010010100101110 1101
                              echo 011011011010110011010101101100100101111 0110
                              goto matrix2
                              pause .nul
                              :matrix2
                              color 0a
                              echo 011000110111001011010100001011100101100 1110
                              echo 010011001110011110010110110010110100110 1100
                              echo 101100101010101010110010010001010010001 0011
                              echo 101100111010101010110101010100010110110 1011
                              echo 011001001010110101001100100010100010101 0011
                              echo 001100101101110101010110010010100101110 1101
                              echo 011011011010110011010101101100100101111 0110
                              goto matrix

                              patio

                              • Moderator


                              • Genius
                              • Maud' Dib
                              • Thanked: 1769
                                • Yes
                              • Experience: Beginner
                              • OS: Windows 7
                              Re: CMD fun
                              « Reply #33 on: February 02, 2010, 01:49:04 PM »
                              ***sigh***
                              " Anyone who goes to a psychiatrist should have his head examined. "

                              JDByler

                              • Guest
                              Re: CMD fun
                              « Reply #34 on: March 17, 2016, 08:04:18 AM »
                              Try this matrix, got bored at school...

                              @echo off
                              color a
                              title LOADING
                              cls
                              tree
                              cls
                              color c
                              title MATRIX (WARNING)
                              cls
                              echo This uses high amounts of cpu but it looks cool.
                              echo Use at your own risk...
                              pause
                              color e
                              title MATRIX (loading)
                              cls
                              echo loading...
                              timeout 1
                              cls
                              echo Loading the matrix, please wait...
                              timeout 44
                              title MATRIX (initiating)
                              cls
                              echo loading...
                              timeout 1
                              cls
                              echo Initiating the matrix, please wait...
                              timeout 14
                              color a
                              title MATRIX (ready)
                              cls
                              echo ready to begin.

                              :choice
                              cls
                              echo type "credits" for the credits
                              set /p c=Are you sure you want to continue[Y/N]?
                              if /I "%c%" EQU "Y" goto :somewhere
                              if /I "%c%" EQU "N" goto :somewhere_else
                              if /I "%c%" EQU "credits" goto :credits
                              goto :choice

                              :somewhere
                              title (loading)
                              cls
                              tree
                              title MATRIX
                              cls
                              :start
                              echo %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% %random%
                              goto :start

                              :somewhere_else
                              exit

                              :credits
                              cls
                              echo (created by: Jacob Byler)
                              echo ([email protected])
                              pause
                              goto :choice

                              zask



                                Intermediate

                                • Experience: Experienced
                                • OS: Other
                                Re: CMD fun
                                « Reply #35 on: March 22, 2016, 10:15:05 PM »
                                You should try something cool like this.

                                @echo off

                                mode 200
                                setlocal

                                call :Echo.Color.Init

                                goto main

                                :Echo.Color %1=Color %2=Str [%3=/n]
                                setlocal enableDelayedExpansion
                                set "str=%~2"
                                :Echo.Color.2
                                :# Replace path separators in the string, so that the final path still refers to the current path.
                                set "str=a%ECHO.DEL%!str:\=a%ECHO.DEL%\..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                set "str=!str:/=a%ECHO.DEL%/..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                set "str=!str:"=\"!"
                                :# Go to the script directory and search for the trailing -
                                pushd "%ECHO.DIR%"
                                findstr /p /r /a:%~1 "^^-" "!str!\..\!ECHO.FILE!" nul
                                popd
                                :# Remove the name of this script from the output. (Dependant on its length.)
                                for /l %%n in (1,1,12) do if not "!ECHO.FILE:~%%n!"=="" <nul set /p "=%ECHO.DEL%"
                                :# Remove the other unwanted characters "\..\: -"
                                <nul set /p "=%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%"
                                :# Append the optional CRLF
                                if not "%~3"=="" echo.
                                endlocal & goto :eof

                                :Echo.Color.Var %1=Color %2=StrVar [%3=/n]
                                if not defined %~2 goto :eof
                                setlocal enableDelayedExpansion
                                set "str=!%~2!"
                                goto :Echo.Color.2

                                :Echo.Color.Init
                                set "ECHO.COLOR=call :Echo.Color"
                                set "ECHO.DIR=%~dp0"
                                set "ECHO.FILE=%~nx0"
                                set "ECHO.FULL=%ECHO.DIR%%ECHO.FILE%"
                                :# Use prompt to store a backspace into a variable. (Actually backspace+space+backspace)
                                for /F "tokens=1 delims=#" %%a in ('"prompt #$H# & echo on & for %%b in (1) do rem"') do set "ECHO.DEL=%%a"
                                goto :eof

                                :1
                                :main
                                call :Echo.Color 0d "%random:~-1,1%"
                                call :Echo.Color 0c "%random:~-1,1%"
                                call :Echo.Color 0e "%random:~-1,1%"
                                call :Echo.Color 0a "%random:~-1,1%"
                                call :Echo.Color 09 "%random:~-1,1%"
                                call :Echo.Color 0b "%random:~-1,1%"
                                call :Echo.Color 0c "%random:~-1,1%"
                                call :Echo.Color 0e "%random:~-1,1%"
                                call :Echo.Color 0a "%random:~-1,1%"
                                call :Echo.Color 09 "%random:~-1,1%"
                                call :Echo.Color 0b "%random:~-1,1%"
                                call :Echo.Color 0d "%random:~-1,1%"
                                call :Echo.Color 0c "%random:~-1,1%"
                                call :Echo.Color 0e "%random:~-1,1%"
                                call :Echo.Color 0a "%random:~-1,1%"
                                call :Echo.Color 09 "%random:~-1,1%"
                                call :Echo.Color 0b"%random:~-1,1%"
                                call :Echo.Color 0d "%random:~-1,1%"
                                call :Echo.Color 0d "%random:~-1,1%"
                                call :Echo.Color 0c "%random:~-1,1%"
                                call :Echo.Color 0e "%random:~-1,1%"
                                call :Echo.Color 0a "%random:~-1,1%"
                                call :Echo.Color 09 "%random:~-1,1%"
                                call :Echo.Color 0b "%random:~-1,1%"

                                goto 1

                                zask



                                  Intermediate

                                  • Experience: Experienced
                                  • OS: Other
                                  Re: CMD fun
                                  « Reply #36 on: March 24, 2016, 06:41:14 PM »
                                  To run it in full screen you could just create a shortcut and under the properties of the shortcut select full screen, that works.

                                  You can make a batch file full screen by typing this

                                  Mode 200

                                  You can change the number 200 to any number 1-200 to change to a specific size.

                                  zask



                                    Intermediate

                                    • Experience: Experienced
                                    • OS: Other
                                    Re: CMD fun
                                    « Reply #37 on: March 24, 2016, 06:57:36 PM »
                                    You should try something cool like this.

                                    @echo off

                                    mode 200
                                    setlocal

                                    call :Echo.Color.Init

                                    goto main

                                    :Echo.Color %1=Color %2=Str [%3=/n]
                                    setlocal enableDelayedExpansion
                                    set "str=%~2"
                                    :Echo.Color.2
                                    :# Replace path separators in the string, so that the final path still refers to the current path.
                                    set "str=a%ECHO.DEL%!str:\=a%ECHO.DEL%\..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                    set "str=!str:/=a%ECHO.DEL%/..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                    set "str=!str:"=\"!"
                                    :# Go to the script directory and search for the trailing -
                                    pushd "%ECHO.DIR%"
                                    findstr /p /r /a:%~1 "^^-" "!str!\..\!ECHO.FILE!" nul
                                    popd
                                    :# Remove the name of this script from the output. (Dependant on its length.)
                                    for /l %%n in (1,1,12) do if not "!ECHO.FILE:~%%n!"=="" <nul set /p "=%ECHO.DEL%"
                                    :# Remove the other unwanted characters "\..\: -"
                                    <nul set /p "=%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%"
                                    :# Append the optional CRLF
                                    if not "%~3"=="" echo.
                                    endlocal & goto :eof

                                    :Echo.Color.Var %1=Color %2=StrVar [%3=/n]
                                    if not defined %~2 goto :eof
                                    setlocal enableDelayedExpansion
                                    set "str=!%~2!"
                                    goto :Echo.Color.2

                                    :Echo.Color.Init
                                    set "ECHO.COLOR=call :Echo.Color"
                                    set "ECHO.DIR=%~dp0"
                                    set "ECHO.FILE=%~nx0"
                                    set "ECHO.FULL=%ECHO.DIR%%ECHO.FILE%"
                                    :# Use prompt to store a backspace into a variable. (Actually backspace+space+backspace)
                                    for /F "tokens=1 delims=#" %%a in ('"prompt #$H# & echo on & for %%b in (1) do rem"') do set "ECHO.DEL=%%a"
                                    goto :eof

                                    :1
                                    :main
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b"%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"

                                    goto 1


                                    My bad, I had accidentally made a mistake. try this instead.

                                    @echo off
                                    mode 200
                                    setlocal

                                    call :Echo.Color.Init

                                    goto main

                                    :Echo.Color %1=Color %2=Str [%3=/n]
                                    setlocal enableDelayedExpansion
                                    set "str=%~2"
                                    :Echo.Color.2
                                    :# Replace path separators in the string, so that the final path still refers to the current path.
                                    set "str=a%ECHO.DEL%!str:\=a%ECHO.DEL%\..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                    set "str=!str:/=a%ECHO.DEL%/..\%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%!"
                                    set "str=!str:"=\"!"
                                    :# Go to the script directory and search for the trailing -
                                    pushd "%ECHO.DIR%"
                                    findstr /p /r /a:%~1 "^^-" "!str!\..\!ECHO.FILE!" nul
                                    popd
                                    :# Remove the name of this script from the output. (Dependant on its length.)
                                    for /l %%n in (1,1,12) do if not "!ECHO.FILE:~%%n!"=="" <nul set /p "=%ECHO.DEL%"
                                    :# Remove the other unwanted characters "\..\: -"
                                    <nul set /p "=%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%%ECHO.DEL%"
                                    :# Append the optional CRLF
                                    if not "%~3"=="" echo.
                                    endlocal & goto :eof

                                    :Echo.Color.Var %1=Color %2=StrVar [%3=/n]
                                    if not defined %~2 goto :eof
                                    setlocal enableDelayedExpansion
                                    set "str=!%~2!"
                                    goto :Echo.Color.2

                                    :Echo.Color.Init
                                    set "ECHO.COLOR=call :Echo.Color"
                                    set "ECHO.DIR=%~dp0"
                                    set "ECHO.FILE=%~nx0"
                                    set "ECHO.FULL=%ECHO.DIR%%ECHO.FILE%"
                                    :# Use prompt to store a backspace into a variable. (Actually backspace+space+backspace)
                                    for /F "tokens=1 delims=#" %%a in ('"prompt #$H# & echo on & for %%b in (1) do rem"') do set "ECHO.DEL=%%a"
                                    goto :eof

                                    :1
                                    :main
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0B "%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0d "%random:~-1,1%"
                                    call :Echo.Color 0c "%random:~-1,1%"
                                    call :Echo.Color 0e "%random:~-1,1%"
                                    call :Echo.Color 0a "%random:~-1,1%"
                                    call :Echo.Color 09 "%random:~-1,1%"
                                    call :Echo.Color 0b "%random:~-1,1%"
                                    goto 1
                                    exit /b

                                    :# The following line must be last and not end by a CRLF.
                                    -

                                    Salmon Trout

                                    • Guest
                                    Re: CMD fun
                                    « Reply #38 on: March 25, 2016, 05:54:48 AM »
                                    You can make a batch file full screen by typing this

                                    Mode 200


                                    Not on my system. Just makes it full height.

                                    DaveLembke



                                      Sage
                                    • Thanked: 662
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: CMD fun
                                    « Reply #39 on: March 25, 2016, 06:17:47 AM »
                                    Surprised I didnt get in on this discussion back in 2008. I must have been AFK back then. Anyways long long time ago ( Late 90s around 1997  ) I was messing around with batches my own and others to learn it, and a person in a Computer Geek type of titled AOL chat room pointed me to M.U.F's  (Microsoft's Undocumented Features ) in DOS on older systems and Command Shell of Windows 95, and while some M.U.F's were only available for certain specific versions of DOS, others were still functional.

                                    Here is  a 1993 edition of M.U.F's http://vetusware.com/download/MicroSofts%20Undocumented%20Features%201.6/?id=12309

                                    Use at own risk!!!

                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #40 on: March 25, 2016, 07:52:09 AM »
                                    Nice find Dave.

                                    That's from Fidonet's Batpower Echo many moons ago.

                                    Here's the latest revision: V1.7

                                    http://astronomy.comoj.com/dostips/muf17.zip




                                    DaveLembke



                                      Sage
                                    • Thanked: 662
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: CMD fun
                                    « Reply #41 on: March 25, 2016, 09:43:25 AM »
                                    Cool I will have to check out that newer 1.7 edition.

                                    For the M.U.F's, I kind of always wondered if someone decompiled DOS to see hidden switch support or ran a looped batch that appended different switches to commands looking for successful ( non error condition returns ) then manually played with the list of successful non error condition switches to determine what they did, or if it was a leak from Microsoft Devs.  ;D

                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #42 on: March 25, 2016, 05:36:11 PM »
                                    Dave, I've read of npocmaka as one individual at Dostips.com , there have been others, who view a binary file in a text viewer or a hex editor, and you can see the switches in plain text inside the binary - and then they experiment with them to try and gauge what they do, and they report on them.  In some cases there is also description inside the file that is merely disabled from being displayed in the help.

                                    npocmaka is clever, methodical, and enjoys the challenge of investigating the OS files. 

                                    DaveLembke



                                      Sage
                                    • Thanked: 662
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: CMD fun
                                    « Reply #43 on: March 26, 2016, 06:00:26 AM »
                                    COOL

                                    Quote
                                    In some cases there is also description inside the file that is merely disabled from being displayed in the help.

                                    Interesting.... Suppressed from view and still part of the program. If commented out it wouldnt be there in the compiled binary state. So its orphan code then I suppose to have static info that is not displayed because another part of the program skips over the section.

                                    Thanks for the info  8)

                                    Salmon Trout

                                    • Guest
                                    Re: CMD fun
                                    « Reply #44 on: March 26, 2016, 06:37:33 AM »
                                    If commented out it wouldnt be there in the compiled binary state.

                                    Weren't the MS-DOS utilities as well as COMMAND.COM written in assembler? There are some interesting posts on Raymond Chen's blog, "The Old New Thing", over at Microsoft, about bugs, etc.

                                    [Update - answered my own question] MS-DOS was written in assembler - all the utilities, kernel, and even installer.

                                    Interesting:  http://www.patersontech.com/dos/origins-of-dos.aspx



                                    « Last Edit: March 26, 2016, 06:52:58 AM by Salmon Trout »

                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #45 on: March 26, 2016, 09:58:28 AM »
                                    Weren't the MS-DOS utilities as well as COMMAND.COM written in assembler?

                                    The page linked says up to MSDOS V1.xx

                                    My impression is that the later versions weren't.  3.3 and onward is what I had experience with.

                                    Salmon Trout

                                    • Guest
                                    Re: CMD fun
                                    « Reply #46 on: March 26, 2016, 10:19:09 AM »
                                    Right up to and including version 6, MS-DOS was written in 8086 assembler. If you look at the source (which is around on the web) you can read modification histories in the various modules starting in 1983 and ending in 1992

                                    A little bit of the source for one of the modules of MS-DOS 6

                                    ;*  Compare names
                                            mov     si,dx                   ; ds:si -> guest name
                                            mov     cx,bx                   ; Length of guest name
                                            repe    cmpsb                   ; Do names match?
                                            jz      fglx                    ;   YES, return success

                                    ;*  Now we either ran past the end of the string in the list, or we are not
                                    ;   at the end, but found a difference.  We back up one character, since
                                    ;   repe cmpsb advanced one character past the difference, and then scan
                                    ;   the string in the list to find its end.

                                            dec     di                      ; es:di -> character that did not match
                                            mov     cx,-1                   ; Make sure we look far enough ahead
                                            repne   scasb                   ; Find tail of name in list

                                    ;*  Now es:[di] is first character of the next name in the list (or 00)

                                    BC_Programmer


                                      Mastermind
                                    • Typing is no substitute for thinking.
                                    • Thanked: 1140
                                      • Yes
                                      • Yes
                                      • BC-Programming.com
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Beginner
                                    • OS: Windows 11
                                    Re: CMD fun
                                    « Reply #47 on: March 26, 2016, 10:42:40 AM »
                                    The page linked says up to MSDOS V1.xx

                                    My impression is that the later versions weren't.  3.3 and onward is what I had experience with.

                                    The only version reference I can find on those pages is the one describing when Patterson was responsible for the program. "Tim Paterson, wrote the first versions -- up through MS-DOS 1.25".

                                    MS-DOS Version 2.0 was written primarily in Assembly. Microsoft made the source available (alongside Word for Windows 1.1) to an online museum and it is available for download there.


                                    MS-DOS 3.0 was released less then a year after 2.1, and it seems unlikely that it was rewritten in another language in that time frame. Rewriting it would have been detrimental anyway. Aside from the additional time needed to do so, there wouldn't be much of a benefit. Obviously those working with it already knew Assembly and compilers had not yet advanced beyond the performance of skilled assembly programmers, so at the time hand-written assembly was usually much faster and smaller than the output from any compiler. (And continued to be well into the 90's, even) The only change visible in the product would be much larger files and much slower execution; not really bullet points to put on the box. Later tools added in later versions might have been written in C; but the core OS and external commands very likely remained written in Assembly throughout the software's lifespan.

                                    (I've been Ninja'd, oh well)

                                    I was trying to dereference Null Pointers before it was cool.

                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #48 on: March 26, 2016, 12:01:10 PM »
                                    I see your points that a re-write into another language would surely break a spitload of stuff, and my impression is clearly wrong.


                                    It's interesting to note the growth of command.com in size over the years.

                                    Code: [Select]
                                    COMMAND.COM    18,016    01/01/1980 01:10  V2.11
                                    COMMAND.COM    25,276    23/07/1987 23:00  V3.3
                                    COMMAND.COM    47,845    09/04/1991 04:00  V5.0
                                    COMMAND.COM    52,925    10/03/1993 06:00  V6.0
                                    COMMAND.COM    54,619    30/09/1993 05:20  V6.2
                                    COMMAND.COM    54,645    31/05/1994 15:22  V6.22




                                    DaveLembke



                                      Sage
                                    • Thanked: 662
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: CMD fun
                                    « Reply #49 on: March 26, 2016, 03:32:46 PM »
                                    COMMAND.COM    18,016    01/01/1980 01:10  V2.11
                                    COMMAND.COM    25,276    23/07/1987 23:00  V3.3
                                    COMMAND.COM    47,845    09/04/1991 04:00  V5.0
                                    COMMAND.COM    52,925    10/03/1993 06:00  V6.0
                                    COMMAND.COM    54,619    30/09/1993 05:20  V6.2
                                    COMMAND.COM    54,645    31/05/1994 15:22  V6.22



                                    DOS 2.11 with a date year of 1980 stood out as wrong... I started with DOS for IBM compatible computers in 1984 and GW-Basic I had so much fun with at school.

                                    https://en.wikipedia.org/wiki/Timeline_of_DOS_operating_systems

                                    Salmon Trout

                                    • Guest
                                    Re: CMD fun
                                    « Reply #50 on: March 26, 2016, 05:47:28 PM »
                                    COMMAND.COM    18,016    01/01/1980 01:10  V2.11
                                    DOS 2.11 with a date year of 1980 stood out as wrong...
                                    Microsoft didn't even buy 86-DOS until December 1980. The date & time 01/01/1980 00:00 represents the start of time for the MS-DOS epoch/date system however. Files get this time stamp when they are corrupted or not fully copied. 86-DOS was about 4,000 lines of assembler code, written in 6 weeks, allegedly, by Tim Paterson.



                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #51 on: March 26, 2016, 07:04:44 PM »
                                    Microsoft didn't even buy 86-DOS until December 1980. The date & time 01/01/1980 00:00 represents the start of time for the MS-DOS epoch/date system however. Files get this time stamp when they are corrupted or not fully copied.

                                    True, or if the system time and date wasn't set the timestamps can be nuked.


                                    BC_Programmer


                                      Mastermind
                                    • Typing is no substitute for thinking.
                                    • Thanked: 1140
                                      • Yes
                                      • Yes
                                      • BC-Programming.com
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Beginner
                                    • OS: Windows 11
                                    Re: CMD fun
                                    « Reply #52 on: March 26, 2016, 08:34:03 PM »
                                    I get a date of 10/20/83 for MS-DOS 2.1
                                    I was trying to dereference Null Pointers before it was cool.

                                    foxidrive



                                      Specialist
                                    • Thanked: 268
                                    • Experience: Experienced
                                    • OS: Windows 8
                                    Re: CMD fun
                                    « Reply #53 on: March 28, 2016, 04:47:07 AM »
                                    A little bit of the source for one of the modules of MS-DOS 6

                                    ;*  Compare names
                                            mov     si,dx                   ; ds:si -> guest name
                                            mov     cx,bx                   ; Length of guest name
                                            repe    cmpsb                   ; Do names match?
                                            jz      fglx                    ;   YES, return success



                                    Thank you kindly!

                                    Your post was clear too, with the source code, that it's assembler in MSDOS.   Windows 10 would run well on a 486 if they had continued that style. ;)

                                    Cheers

                                    pm's are broken