Quick beep via command line.

Discussion in 'Scripting' started by Dark Dinosaur, Jan 1, 2022.

  1. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    3,702
    5,104
    120
    #1 Dark Dinosaur, Jan 1, 2022
    Last edited: Jan 15, 2022
    I hope it interesting someone
    better way than Alt 007 OR Alt 7 OR Ctrl ^G OR start foo OR rundll32 Command
    Add more 0 to get more Beep :D

    1 Beep version
    Code:
    use this nice code
    -- echo 0Y | choice
    Clean Command line
    -- echo 0Y | >nul choice
    
    5 Beep version
    Code:
    use this nice code
    -- echo 00000Y | choice
    Clean Command line
    -- echo 00000Y | >nul choice
    
    10 Beep version
    Code:
    use this nice code
    -- echo 0000000000Y | choice
    Clean Command line
    -- echo 0000000000Y | >nul choice
    
    Beep generator Script
    ** Make sure EnableDelayedExpansion is Set **
    Example :: call :GenerateBeeps Number>0
    Example :: call :GenerateBeeps Arithmetic Function

    call :GenerateBeeps 1
    call :GenerateBeeps 9*3
    call :GenerateBeeps 3-1
    call :GenerateBeeps 2*2+1

    Code:
    :GenerateBeeps
    set "zeroList="
    set /a Length=%*-1
    for /L %%$ in (0,1,!Length!) do set "zeroList=!zeroList!0"
    echo !zeroList!Y | >nul Choice
    goto :eof
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...