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

Author Topic: Batch Programs Thread.  (Read 722054 times)

0 Members and 1 Guest are viewing this topic.

shanked



    Beginner
    • Experience: Familiar
    • OS: Windows Vista
    Re: Batch Programs Thread.
    « Reply #480 on: November 26, 2010, 03:11:37 PM »

    Code: [Select]
    @echo off
    :A
    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 :A


    Haha nice..but you should make the colors random...like so :D
    Code: [Select]
    ::~~This line below makes the screen bigger
    mode con lines=100 cols=200
    :start
    @echo off
    set /a R=%random%%%15+1
    @echo off
    set /a R=%random%%%15+1

    if '%R%'=='1' goto :A
    if '%R%'=='2' goto :B
    if '%R%'=='3' goto :C
    if '%R%'=='4' goto :D
    if '%R%'=='5' goto :E
    if '%R%'=='6' goto :F
    if '%R%'=='7' goto :G
    if '%R%'=='8' goto :H
    if '%R%'=='9' goto :I
    if '%R%'=='10' goto :J
    if '%R%'=='11' goto :K
    if '%R%'=='12' goto :L
    if '%R%'=='13' goto :M
    if '%R%'=='14' goto :N
    if '%R%'=='15' goto :O

    :A
    color 10
    goto :start

    :B
    color 20
    goto :start

    :C
    color 30
    goto :start

    :D
    color 40
    goto :start

    :E
    color 50
    goto :start

    :F
    color 60
    goto :start

    :G
    color 70
    goto :start

    :H
    color 80
    goto :start

    :I
    color 90
    goto :start

    :J
    color a0
    goto :start

    :K
    color b0
    goto :start

    :L
    color c0
    goto :start

    :M
    color d0
    goto :start

    :N
    color e0
    goto :start

    :O
    color f0
    goto :start


    Didn't take as long as you might think, c/p job lol

    But really guys if you can get a seizure don't do this O.o
    « Last Edit: November 26, 2010, 03:24:21 PM by shanked »
    ...

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Batch Programs Thread.
    « Reply #481 on: December 01, 2010, 05:08:06 AM »
    Does it have to be something big and complicated to add to this thread?
    When I was weaning myself from Linux. I found myself typing 'ls' when I should have did 'dir' and that lead me to make this short batch named 'ls.bat' which is :
    Code: [Select]
    dir %1 %2 That's my best!

    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: Batch Programs Thread.
    « Reply #482 on: December 01, 2010, 10:15:31 AM »
    I found myself doing the opposite in the terminal of Linux Mint, but to my surprise it actually gave me ls output when I typed "dir".
    I was trying to dereference Null Pointers before it was cool.

    Salmon Trout

    • Guest
    Re: Batch Programs Thread.
    « Reply #483 on: December 01, 2010, 10:23:03 AM »
    I found myself doing the opposite in the terminal of Linux Mint, but to my surprise it actually gave me ls output when I typed "dir".

    It's in the default set of aliases, I think.


    ghostdog74



      Specialist

      Thanked: 27
      Re: Batch Programs Thread.
      « Reply #484 on: December 24, 2010, 03:41:32 AM »
      It's in the default set of aliases, I think.
      it can either be an alias, or installed by coreutils. Highly likely its from coreutils.

      millergram



        Rookie

        • Experience: Beginner
        • OS: Windows Vista
        Re: Batch Programs Thread.
        « Reply #485 on: January 25, 2011, 08:11:52 PM »
        Can i use that bat file in a larger bat file of mine will credit you for creation of course

        polle123



          Rookie

          • Experience: Beginner
          • OS: Unknown
          Re: Batch Programs Thread.
          « Reply #486 on: February 05, 2011, 06:19:53 AM »
          This is my big batch file that i made to get the hang of how batch worked.
          It's quite big, and it requires the correct enviroment to be set up. So running this batch file on your own computer would require reverse engeneering wath it needs, so don't try it.

          NOTE: this file is based on the idea that "C:\Program Files\CwindowsMD" is a hidden location that has hidden files, if "C:\Program Files\CwindowsMD" is know, the security is compromised :) , also, this batch file is to be converted to an exe so it cannot be viewed.

          NOTE2: i wrote this file as a test for my brother, the task was to crack the password without triggering the penalty. the solution is a bruteforce that closes the program when it is in the ":minus" section. because, at this point you know the pass was incorrect, the Number of tries has been decreased by 1, but it will not be written to temp.bat for 2 seconds. So closing the program at this point is the key to breaking the security.

          I hope someone learns something from this :)

          Code: [Select]
          @echo off
          title Polles hideout
          set systempass=lightning    REM this sets the default pass to lightning, this pass will be overwritten if "temp.bat" is called
          set NoT=1                         REM this sets the number of password tries to default 1, this will be overwritten if "temp.bat" is called
          CALL "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"     REM this will set the saved password and the amount of tries left (if not found, it will use the 2 above commands)
          ;;
          ;; Pogingen
          ;;
          :try
          cls
          if %NoT% EQU 0 goto close    REM if you are out of password atempts, you will face penalty
          echo set NoT=%NoT% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"    REM will save the number of atempts, so one cannot keep trying by restarting the batch file (can be circumvented)
          echo U have %NoT% try(s) left
          set /p check= Enter the password:
          if %systempass% EQU %check% goto correct
          if %systempass% NEQ %check% goto minus
          ;;
          ;;minus
          ;;
          :minus
          cls
          set /a NoT=%NoT% -1    REM decreases number of tries by 1
          echo WRONG!! Try again in 2 seconds.
          ping localhost -n 2 -w 1000 > nul    REM waiting 2 seconds (this breaks the security)
          goto try
          ;;
          ;; correct
          ;;
          :correct
          cls
          echo Correct password!!     REM password correct, continue to options
          ping localhost -n 1 -w 1000 > nul
          goto options
          ;;
          ;; KEUZE KIEZER1
          ;;
          :options
          cls
          echo options: "hidden"/"latest"/"NoTset"/"changepass"/"winsatfun"/"game1"/"game2"
          set /p options= What do you want to do now?
          if %options% EQU hidden goto hidden                      REM will open "C:\Program Files\CwindowsMD\"
          if %options% EQU latest goto latest                         REM will open latest version of this batch file (non converted version)
          if %options% EQU NoTset goto NoTset                     REM Change the number of tries for the next attempt
          if %options% EQU changepass goto changepass        REM change the password
          if %options% EQU winsatfun goto winsatfun              REM have fun using windows visualisation (works on vista, don't know about others)
          if %options% EQU game1 goto game1                      REM run 1st batch game
          if %options% EQU game2 goto game2                      REM run 2nd batch game, these games are not mine, so i won't post them here
          goto optionswrong
          :optionswrong
          cls
          echo That is not an available option           REM obvious, returns to the option-select menu
          echo select another option in 2 seconds
          ping localhost -n 2 -w 1000 > nul
          goto options
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; optie1 (verborgen map openen)
          ;;
          :hidden
          cls
          cd C:\Program Files\
          start CwindowsMD
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; optie2 (laatste versie van password)
          ;;
          :latest
          cls
          cd C:\Program Files\CwindowsMD\batch-bestanden
          notepad password.bat
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; optie3 (NoTset)
          ;;
          :NoTset
          cls
          echo please set the number of trys for the next login attempt
          set /p RNoT= number of trys:
          echo set NoT=%RNoT% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; optie4 (changepass)
          ;;
          :changepass
          cls
          echo please type in the old password
          set /p Oldsystempass= Old password:
          if %Oldsystempass% NEQ %systempass% goto wrongpass
          cls
          echo please set the new password
          set /p Newsystempass= New password:
          set /p Newsystempass2= Confirm new password:
          if %Newsystempass% NEQ %Newsystempass2% goto wrongpass
          echo set systempass=%Newsystempass% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options
          ;;
          :wrongpass
          cls
          echo The 2 passwords did not match
          echo Please try again in 2 seconds
          ping localhost -n 2 -w 1000 > nul
          goto changepass
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; optie5 (Winsat)
          ;;
          :winsatfun
          cls
          set numberobj=
          set Cnumber=
          set texshader=
          set texshader2=
          set alushader=
          set alushader2=
          set totaltex=
          set totaltex2=
          set texnumber=
          set texperobject=
          set texperobject2=
          set texperobjectnumber=
          set noalpha=
          echo Try out your own winsat visualisations!
          echo HAVE FUN
          set /p numberobj= please enter the number of objects:
          set /p Cnumber= please enter the fatness of an object (1-100):
          set /p texshader= Do you want to use texshader? (yes/no):
          set /p alushader= Do you want to use alushader? (yes/no):
          set /p totaltex= Do you want to set the totaltexture? (yes/no):
          if %totaltex% EQU yes set /p texnumber=Set the totaltexture(1-100):
          set /p texperobject= Do you want to set the texture per object? (yes/no):
          if %texperobject% EQU yes set /p texperobjectnumber=Set the texture per object(1-100):
          set /p noalpha= Do you want to use "noalpha"? (yes/no)
          ;;
          ;;
          if %texshader% EQU yes (set texshader2=-texshader)
          if %alushader% EQU yes (set alushader2=-alushader)
          if %totaltex% EQU yes (set totaltex2=-totaltex %texnumber%)
          if %texperobject% EQU yes set texperobject2=-texpobj C(%texperobjectnumber%)
          if %noalpha% EQU yes (set noalpha2=-noalpha)
          winsat d3d -objs C(%Cnumber%) -totalobj %numberobj% %texshader2% %alushader2% %totaltex2% %texperobject2% %noalpha2%
          echo.
          echo.
          echo press any button to restart winsatfun
          pause > nul
          goto winsatfun
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;;
          ;; AFSLUITEN
          ;;
          :close
          cd C:\Program Files\CwindowsMD\vbs\
          start pop-uppassword.vbs                         REM runs a vb-script that pops up multiple windows to distract hacker
          cd C:\Program Files\CwindowsMD\batch-bestanden\shutdown\
          start shutdown.bat                                    REM runs a shutdown batch file
          exit
          ;;
          ;;
          ;;
          ;;
          :game1
          cd C:\Program Files\CwindowsMD\batch-bestanden\extra\
          start Tic-Tac-Toe.bat
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options
          ;;
          ;;
          ;;
          ;;
          :game2
          cd C:\Program Files\CwindowsMD\batch-bestanden\extra\
          start dark_kingdoms_v1_2_1.bat
          echo DONE!
          echo Press any key to return to "option select"
          pause > nul
          goto options


          The winsat testing part of the batch file. Try it out, it's really cool (run as admin)
          Code: [Select]
          @echo off
          :winsatfun
          cls
          set numberobj=
          set Cnumber=
          set texshader=
          set texshader2=
          set alushader=
          set alushader2=
          set totaltex=
          set totaltex2=
          set texnumber=
          set texperobject=
          set texperobject2=
          set texperobjectnumber=
          set noalpha=
          echo Try out your own winsat visualisations!
          echo HAVE FUN
          set /p numberobj= please enter the number of objects:
          set /p Cnumber= please enter the fatness of an object (1-100):
          set /p texshader= Do you want to use texshader? (yes/no):
          set /p alushader= Do you want to use alushader? (yes/no):
          set /p totaltex= Do you want to set the totaltexture? (yes/no):
          if %totaltex% EQU yes set /p texnumber=Set the totaltexture(1-100):
          set /p texperobject= Do you want to set the texture per object? (yes/no):
          if %texperobject% EQU yes set /p texperobjectnumber=Set the texture per object(1-100):
          set /p noalpha= Do you want to use "noalpha"? (yes/no)
          ;;
          ;;
          if %texshader% EQU yes (set texshader2=-texshader)
          if %alushader% EQU yes (set alushader2=-alushader)
          if %totaltex% EQU yes (set totaltex2=-totaltex %texnumber%)
          if %texperobject% EQU yes set texperobject2=-texpobj C(%texperobjectnumber%)
          if %noalpha% EQU yes (set noalpha2=-noalpha)
          winsat d3d -objs C(%Cnumber%) -totalobj %numberobj% %texshader2% %alushader2% %totaltex2% %texperobject2% %noalpha2%
          echo.
          echo.
          echo press any button to restart winsatfun
          pause > nul
          goto winsatfun
          « Last Edit: February 05, 2011, 06:43:32 AM by polle123 »

          polle123



            Rookie

            • Experience: Beginner
            • OS: Unknown
            Re: Batch Programs Thread.
            « Reply #487 on: February 05, 2011, 06:44:51 AM »
            my backup manager batch file.
            This is a really static file. It is speciffically designed for my own files. If yu want to use this for your own, it will require a HUGE amount of editting

            Code: [Select]
            @echo off

            title = Folder Backup!  (program by Polle)
            color 0e
            MKDIR %~d0\Music
            MKDIR %~d0\willekeurig
            MKDIR %~d0\Vuze
            MKDIR %~d0\batch
            MKDIR %~d0\CwindowsMD
            cls





            set /P backup= Backup van alles maken? (j/n) :
            if %backup% EQU j goto B

            set /P muziek= Backup van muziek maken? (j/n) :
            set /P willekeurig= Backup van documenten maken? (j/n) :
            set /P Vuze= Backup van Vuze maken? (j/n) :
            set /P Batch= Backup van batch bestanden maken? (j/n) :
            goto A




            :A


            set start1=%time:~0,2%
            set start2=%time:~3,2%
            set start3=%time:~6,2%
            set starttime=%start1%:%start2%:%start3%


            title = making music backup... (program by Polle)
            if %muziek% EQU j xcopy /d /c /y "C:\Users\Polle\Music" "%~d0\Music"
            for /r "%~d0\Music\" %%F in (*.*) do echo %%F>> file.txt
            for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
            del file.txt



            title = making documents backup... (program by Polle)
            if %willekeurig% EQU j xcopy /s /d /c /y "C:\Users\Polle\willekeurig" "%~d0\willekeurig\"
            for /r "%~d0\willekeurig\" %%F in (*.*) do echo %%F>> file.txt
            for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
            del file.txt



            title = making Vuze backup... (program by Polle)
            if %Vuze% EQU j xcopy /s /d /c /y "C:\Users\Polle\Vuze" "%~d0\Vuze\"
            for /r "%~d0\Vuze\" %%F in (*.*) do echo %%F>> file.txt
            for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
            del file.txt


            title = making batch backup... (program by Polle)
            if %Batch% EQU j xcopy /s /d /c /y "C:\Users\Polle\Desktop\batch" "%~d0\batch\"
            if %Batch% EQU j xcopy /s /d /c /y /h "C:\Program Files\CwindowsMD" "%~d0\CwindowsMD"
            for /r "%~d0\batch\" %%F in (*.*) do echo %%F>> file.txt
            for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\Desktop\%%I\%%J" del "%~d0\%%I\%%J"
            del file.txt
            for /r "%~d0\CwindowsMD\" %%F in (*.*) do echo %%F>> file.txt
            for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Program Files\%%I\%%J" del "%~d0\%%I\%%J"
            del file.txt


            for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"


            set stop1=%time:~0,2%
            set stop2=%time:~3,2%
            set stop3=%time:~6,2%
            set stoptime=%stop1%:%stop2%:%stop3%

            set /A result1=%stop1% - %start1%
            set /A result2=%stop2% - %start2%
            set /A result3=%stop3% - %start3%


            if %result2% LSS 0 set /A result2=60 + %result2% & set /A result1=%result1% - 1
            if %result3% LSS 0 set /A result3=60 + %result3% & set /A result2=%result2% - 1
            set resulttime=%result1%:%result2%:%result3%


            cls
            echo start = %starttime%
            echo stop = %stoptime%
            echo duration = %resulttime%
            pause


            exit






            :B
            set muziek=j
            set willekeurig=j
            set Vuze=j
            set Batch=j
            goto A


            millergram



              Rookie

              • Experience: Beginner
              • OS: Windows Vista
              Re: Batch Programs Thread.
              « Reply #488 on: February 11, 2011, 11:59:36 PM »
              working Taskkill manager thingy
              Code: [Select]
              @echo off
              :main
              title TaskKiller
              Echo.        TaskKill Single Tasks
              echo.
              Echo.TaskKiller Input task to kill
              Echo.Input Tree to taskKill taskTree
              echo.Input List to list All Tasks
              set /p task=Input=
              cls
              if /i "%task%"=="tree" goto task1
              if /i "%task%"=="list" goto list
              if /I %task% equ %task% goto task

              :task
              cls
              if not exist %task% goto no
              @echo on
              taskkill /f /im %task%
              @echo off
              pause
              goto main

              :no
              cls
              Echo.Does Not Exist
              pause
              goto main

              :task1
              title TaskKill Tree
              ECho.      TaskKill TaskTREEs
              echo.
              echo.Input back to return
              echo.Input List to list Tasks
              set /p task1=Input=
              cls
              if /i "%task1%"=="back" goto main
              if /i "%task1%"=="list" goto list1
              if /I %task1% equ %task1% goto task2

              :task2
              cls
              if not exist %task1% goto no1
              @echo on
              taskkill /f /t /im %task1%
              @echo off
              pause
              goto main

              :no1
              cls
              Echo.Does Not Exist
              pause
              goto task1

              :list
              tasklist
              pause
              goto main

              :list1
              tasklist
              pause
              goto task1

              Dont press enter without any thing typed just closes any way to stop that???

              Salmon Trout

              • Guest
              Re: Batch Programs Thread.
              « Reply #489 on: February 12, 2011, 01:11:18 AM »
              Dont press enter without any thing typed just closes any way to stop that???

              Code: [Select]
              :loop
              Echo.TaskKiller Input task to kill
              Echo.Input Tree to taskKill taskTree
              echo.Input List to list All Tasks
              set /p task=Input=
              if not "%Input%"=="" goto next
              echo You pressed Enter only
              goto loop
              :next

              millergram



                Rookie

                • Experience: Beginner
                • OS: Windows Vista
                Re: Batch Programs Thread.
                « Reply #490 on: February 12, 2011, 05:01:44 PM »
                Code: [Select]
                @echo off
                set a=0
                set b=0
                :main
                set /a b=%b%+1
                if %a%==10000 goto stop
                set /a a=(%random% %%10000)+1
                echo %a%
                goto main

                :stop
                echo.Times Till %a% reached=%b%
                pause

                Generates random codes until it reaches 10000
                made it one day when i got board

                Geek-9pm


                  Mastermind
                • Geek After Dark
                • Thanked: 1026
                  • Gekk9pm bnlog
                • Certifications: List
                • Computer: Specs
                • Experience: Expert
                • OS: Windows 10
                Re: Batch Programs Thread.
                « Reply #491 on: February 12, 2011, 05:12:52 PM »
                Quote
                Generates random codes until it reaches 10000
                made it one day when i got board
                You were so bored - you left the program running.   ::)

                maymon123



                  Rookie

                  • Experience: Familiar
                  • OS: Windows XP
                  Re: Batch Programs Thread.
                  « Reply #492 on: February 15, 2011, 10:56:55 AM »
                  Here's a quick and effective batch that i am sure someone already posted....
                  Code: [Select]
                  @echo off
                  :TOP
                  start "firefox" "C:\Program Files\Mozilla Firefox\firefox.exe"
                  goto :TOP
                  I LOVE LOOP FILES!!!!!!!!!

                  Salmon Trout

                  • Guest
                  Re: Batch Programs Thread.
                  « Reply #493 on: February 15, 2011, 10:59:50 AM »
                  Here's a quick and effective batch that i am sure someone already posted....
                  Code: [Select]
                  @echo off
                  :TOP
                  start "firefox" "C:\Program Files\Mozilla Firefox\firefox.exe"
                  goto :TOP
                  I LOVE LOOP FILES!!!!!!!!!

                  Isn't that kinda dumb? What is it supposed to do? (Apart from continually start Firefox?)


                  Geek-9pm


                    Mastermind
                  • Geek After Dark
                  • Thanked: 1026
                    • Gekk9pm bnlog
                  • Certifications: List
                  • Computer: Specs
                  • Experience: Expert
                  • OS: Windows 10
                  Re: Batch Programs Thread.
                  « Reply #494 on: February 15, 2011, 11:38:37 AM »
                  Isn't that kinda dumb? What is it supposed to do? (Apart from continually start Firefox?)
                  Entertainment?
                  Quote
                  definition for entertainment
                  an activity that is diverting and that holds the attention...