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 662265 times)

0 Members and 1 Guest are viewing this topic.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Batch Programs Thread.
« Reply #540 on: November 15, 2011, 06:28:53 PM »
That's just perfect...why are we still even entertaining this ? ?
" Anyone who goes to a psychiatrist should have his head examined. "

ekto



    Greenhorn

    • Experience: Beginner
    • OS: Unknown
    Re: Batch Programs Thread.
    « Reply #541 on: December 01, 2011, 12:18:47 PM »
    hey guys new here, i wanted to pick your brains as im struggling to find an answer to what im looking for!

    basically ive got some software that my dad had wrote by a programmer it ships with hardware he sells, (vehicle diagnostics etc) im editting his installer that runs from a usb key which also acts as a security dongle so it has to be by dongle and i cant switch to CD or DVD , it uses a batch file which i will eventually convert into a .exe as long as the code all works

    the batch file works great, it all installs fine and goes thru spot on and everything is fine, the only thing i cant get to grips with is i would like to delete some driver files from the usb once it has installed once this is so people who try to steal the software once its been installed once will be missing crucial drivers(long story but go with me on this one for now!) my problem is when you put in a usb key, its normally a different drive letter everytime, so i cant link to a static drive letter to delete from  ie; C:/ D:/ etc etc, ive tried using CD\ (to go to top directory) and then DEL for delete but i cant seem to get it to work, im not overly experienced with ms dos, but ive coded in other languages so i understand the fundamentals just not the syntax,

    heres what i have:

    @ECHO Y
    CD\
    del folder/file1.dll
    del folder/file2.dll
    del folder/file3.dll
    del folder/file4.dll

    i know its probably rubbish but hey ive tried for days on this before asking for help! thanks

    Steve

    Salmon Trout

    • Guest
    Re: Batch Programs Thread.
    « Reply #542 on: December 01, 2011, 12:53:44 PM »
    I expect you know about the replaceable parameters %1 to %9. Well, there is another one: %0 (that's a zero after the percent symbol). This is a special variable: it contains the batch script's identity.

    If you have a batch script called Hello.bat and it contains this line:

    Code: [Select]
    echo This script is %0
    When it runs, on the screen will be echoed:

    Code: [Select]
    This script is Hello.bat
    You can use the same standard variable modifiers with the tilde ~ symbol that work with %1 to %9 and also with FOR variables.

    Code: [Select]
        %~I         - expands %I removing any surrounding quotes (")
        %~fI        - expands %I to a fully qualified path name
        %~dI        - expands %I to a drive letter only
        %~pI        - expands %I to a path only
        %~nI        - expands %I to a file name only
        %~xI        - expands %I to a file extension only
        %~sI        - expanded path contains short names only
        %~aI        - expands %I to file attributes of file
        %~tI        - expands %I to date/time of file
        %~zI        - expands %I to size of file

    The I is just a letter used for explanation purposes in the documentation for the FOR command.

    So in a batch script %~d0 will expand to the drive letter of the drive that the script is on. %~d0:\ is the root directory of that drive. 






    ekto



      Greenhorn

      • Experience: Beginner
      • OS: Unknown
      Re: Batch Programs Thread.
      « Reply #543 on: December 01, 2011, 01:29:56 PM »
      thanks this makes sense, but defo aches my brain haha!

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Batch Programs Thread.
      « Reply #544 on: December 01, 2011, 04:54:46 PM »
      thanks this makes sense, but defo aches my brain haha!

      Not quite sure what that means so i'll have to say i agree...
      " Anyone who goes to a psychiatrist should have his head examined. "

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Batch Programs Thread.
      « Reply #545 on: December 01, 2011, 06:18:05 PM »
      Defo. a shortening of definitely for use when responding in agreement ...

      ...the defo program runs on an Apple OS, not MS DOS.

      Salmon Trout

      • Guest
      Re: Batch Programs Thread.
      « Reply #546 on: December 02, 2011, 12:12:15 AM »
      %~d0:\ is the root directory of that drive.

      Correction: %~d0\ is the root directory of the drive on which the batch file is located. (The colon is included automatically)

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Batch Programs Thread.
      « Reply #547 on: December 02, 2011, 08:10:22 AM »
      Correction: %~d0\ is the root directory of the drive on which the batch file is located. (The colon is included automatically)
      Where do you find this stuff?

      Salmon Trout

      • Guest
      Re: Batch Programs Thread.
      « Reply #548 on: December 02, 2011, 11:02:39 AM »
      Where do you find this stuff?

      It's all in the Microsoft Command Line Reference

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Batch Programs Thread.
      « Reply #549 on: December 02, 2011, 11:32:21 AM »
      It's all in the Microsoft Command Line Reference
      Like this?
      Command-line Reference  Updated: October 25, 2010
      http://technet.microsoft.com/en-us/library/cc754340%28WS.10%29.aspx

      Salmon Trout

      • Guest
      Re: Batch Programs Thread.
      « Reply #550 on: December 02, 2011, 11:39:07 AM »

      millergram



        Rookie

        • Experience: Beginner
        • OS: Windows Vista
        Re: Batch Programs Thread.
        « Reply #551 on: December 23, 2011, 02:08:24 PM »
        Heres A batch For a Alarm Clock :)

        Code: [Select]
        @echo off
        Title Alarm
        :Main1
        set HR=00
        set MN=00
        set SC=00
        :Main
        cls
        Echo.set Time
        Echo.%time%
        Echo.Use Time Format 00:00:00
        set /p HR=Hours:
        goto T1
        :T1
        cls
        Echo.set Time
        Echo.%time%
        Echo.%HR%:%MN%:%SC%
        set /p MN=Mins:
        Goto T2
        :T2
        cls
        Echo.set Time
        Echo.%time%
        Echo.%HR%:%MN%:%SC%
        set /p SC=Seconds:
        goto T3
        :T3
        cls
        Echo.set Time
        Echo.%time%
        Echo.%HR%:%MN%:%SC%
        set /p Ok=Yes:1? No:2?=
        if "%Ok%"=="1" Goto Cont
        if /i "%Ok%"=="yes" Goto Cont
        if "%Ok%"=="2" Goto Main1
        if /i "%Ok%"=="no" Goto Main1
        if "%Ok%"=="" Goto T3
        if "%Ok%"=="%Ok%" Goto T3
        :Cont
        set TT=%HR%:%MN%:%SC%.00
        cls
        title %TT%
        echo.%time%
        if "%time%"=="%HR%:%MN%:%SC%.00" goto wake
        goto Cont
        :wake
        Echo.Wake Up!!!
        cd %programfiles%
        cd *windows Media*
        wmplayer "Path of your audio file"
        Echo.Press A Key To Turn Off.
        pause>nul

        Lemonilla



          Apprentice

        • "Too sweet"
        • Thanked: 70
        • Computer: Specs
        • Experience: Experienced
        • OS: Windows 7
        Re: Batch Programs Thread.
        « Reply #552 on: June 06, 2012, 05:36:58 PM »
        3 floor maze

        TEXT WALL WARNING  ;D
        Code: [Select]
        @echo off
        title Maze by Lemonilla
        set /p clr=<clr.maz
        color %clr%
        cd bin
        :start
        cls
        echo 1 Casual
        echo 2 Easy
        echo 3 Moderate
        echo 4 Hard
        echo 5 Imposable
        echo.
        choice /c 12345 /n /m "Select Dificulty"
        set f=1
        cls
        IF %errorlevel%==1 set mr=101
        IF %errorlevel%==2 set mr=51
        IF %errorlevel%==3 set mr=31
        IF %errorlevel%==4 set mr=16
        IF %errorlevel%==5 set mr=6
        IF %errorlevel%==1 goto 1
        IF %errorlevel%==2 goto 1
        IF %errorlevel%==3 goto 1
        IF %errorlevel%==4 goto 1
        IF %errorlevel%==5 goto 1
        goto start
        :1
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 1
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 1
        IF %errorlevel%==2 goto 1
        IF %errorlevel%==3 goto 1
        IF %errorlevel%==4 goto 3
        IF %errorlevel%==5 goto 3
        IF %errorlevel%==6 goto 2
        goto 1

        :2
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 2 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 1
        IF %errorlevel%==2 goto 2
        IF %errorlevel%==3 goto 2
        IF %errorlevel%==4 goto 3
        IF %errorlevel%==5 goto 4
        IF %errorlevel%==6 goto 5
        goto 2

        :3
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 3 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 1
        IF %errorlevel%==2 goto 1
        IF %errorlevel%==3 goto 8
        IF %errorlevel%==4 goto 9
        IF %errorlevel%==5 goto 9
        IF %errorlevel%==6 goto 2
        goto 3

        :4
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 4 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 6
        IF %errorlevel%==2 goto 2
        IF %errorlevel%==3 goto 7
        IF %errorlevel%==4 goto 7
        IF %errorlevel%==5 goto 6
        IF %errorlevel%==6 goto 5
        goto 4

        :5
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 5 
        echo Moves Remaining: %mr%
        type r2.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 2
        IF %errorlevel%==2 goto 4
        IF %errorlevel%==3 goto 14
        IF %errorlevel%==4 goto 6
        IF %errorlevel%==5 goto 7
        goto 5

        :6
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 6 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 5
        IF %errorlevel%==2 goto 4
        IF %errorlevel%==3 goto 7
        IF %errorlevel%==4 goto 7
        IF %errorlevel%==5 goto 6
        IF %errorlevel%==6 goto 6
        goto 6

        :7
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 7 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 4
        IF %errorlevel%==2 goto 4
        IF %errorlevel%==3 goto 9
        IF %errorlevel%==4 goto 5
        IF %errorlevel%==5 goto 6
        IF %errorlevel%==6 goto 6
        goto 7

        :8
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 8 
        echo Moves Remaining: %mr%
        type r5.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 8
        IF %errorlevel%==2 goto 8
        IF %errorlevel%==3 goto 9
        IF %errorlevel%==4 goto 3
        goto 8

        :9
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 9 
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 3
        IF %errorlevel%==2 goto 8
        IF %errorlevel%==3 goto 9
        IF %errorlevel%==4 goto 9
        IF %errorlevel%==5 goto 7
        IF %errorlevel%==6 goto 3
        goto 9

        :10
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 10
        echo Moves Remaining: %mr%
        type r4.maz
        echo.
        echo.
        choice /c abcdefgh /n /m "Select Door"
        IF %errorlevel%==1 goto 3
        IF %errorlevel%==2 goto 3
        IF %errorlevel%==3 goto 11
        IF %errorlevel%==4 goto 12
        IF %errorlevel%==5 goto 13
        IF %errorlevel%==6 goto 14
        IF %errorlevel%==7 goto 10
        IF %errorlevel%==8 goto 10
        goto 10

        :11
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 11
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 10
        IF %errorlevel%==2 goto 3
        IF %errorlevel%==3 goto 6
        IF %errorlevel%==4 goto 12
        IF %errorlevel%==5 goto 12
        IF %errorlevel%==6 goto 12
        goto 11

        :12
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 12
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 11
        IF %errorlevel%==2 goto 11
        IF %errorlevel%==3 goto 11
        IF %errorlevel%==4 goto 6
        IF %errorlevel%==5 goto 13
        IF %errorlevel%==6 goto 10
        goto 12

        :13
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 13
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 14
        IF %errorlevel%==2 goto 10
        IF %errorlevel%==3 goto 12
        IF %errorlevel%==4 goto cf%f%
        IF %errorlevel%==5 goto 14
        IF %errorlevel%==6 goto 14
        goto 13

        :14
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 14
        echo Moves Remaining: %mr%
        type r3.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 13
        IF %errorlevel%==2 goto 13
        IF %errorlevel%==3 goto 10
        IF %errorlevel%==4 goto 13
        IF %errorlevel%==5 goto 5
        goto 14

        :cf1
        cls
        0>nul set /p=Floor: # 
        0>nul set /p=Room: #
        echo Moves Remaining: %mr%
        echo Congrats! You have compleated Floor 1
        set /a f+=1
        echo.
        echo.
        echo You earn an extra 10 turns!
        set /a mr+=10
        pause>nul
        goto 15

        :15
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 15
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 15
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 21
        IF %errorlevel%==5 goto 20
        IF %errorlevel%==6 goto 16
        goto 15

        :16
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 16
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 15
        IF %errorlevel%==3 goto 20
        IF %errorlevel%==4 goto 20
        IF %errorlevel%==5 goto 18
        IF %errorlevel%==6 goto 17
        goto 16

        :17
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 17
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 16
        IF %errorlevel%==3 goto 18
        IF %errorlevel%==4 goto 18
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 15
        goto 17

        :18
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 18
        echo Moves Remaining: %mr%
        type r6.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 16
        IF %errorlevel%==2 goto 17
        IF %errorlevel%==3 goto 17
        IF %errorlevel%==4 goto 24
        IF %errorlevel%==5 goto 19
        goto 18

        :19
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 19
        echo Moves Remaining: %mr%
        type r2.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 27
        IF %errorlevel%==2 goto 27
        IF %errorlevel%==3 goto 18
        IF %errorlevel%==4 goto 23
        IF %errorlevel%==5 goto 24
        goto 19

        :20
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 20
        echo Moves Remaining: %mr%
        type r6.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 16
        IF %errorlevel%==3 goto 16
        IF %errorlevel%==4 goto 23
        IF %errorlevel%==5 goto 21
        goto 20

        :21
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 21
        echo Moves Remaining: %mr%
        type r2.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 22
        IF %errorlevel%==3 goto 20
        IF %errorlevel%==4 goto 23
        IF %errorlevel%==5 goto 23
        goto 21

        :22
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 22
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 21
        IF %errorlevel%==2 goto 15
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 21
        goto 22

        :23
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 23
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 20
        IF %errorlevel%==2 goto 21
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 19
        goto 23

        :24
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 24
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 18
        IF %errorlevel%==2 goto 19
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 15
        goto 24

        :25
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 25
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 15
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 28
        IF %errorlevel%==5 goto 27
        IF %errorlevel%==6 goto 26
        goto 25

        :26
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 26
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 15
        IF %errorlevel%==2 goto 25
        IF %errorlevel%==3 goto 27
        IF %errorlevel%==4 goto 29
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 15
        goto 26

        :27
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 27
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 19
        IF %errorlevel%==2 goto 25
        IF %errorlevel%==3 goto 28
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto 29
        IF %errorlevel%==6 goto 26
        goto 27

        :28
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 28
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 25
        IF %errorlevel%==2 goto 15
        IF %errorlevel%==3 goto 15
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto cf%f%
        IF %errorlevel%==6 goto 27
        goto 28

        :29
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 29
        echo Moves Remaining: %mr%
        type r1.maz
        echo.
        echo.
        choice /c abcdef /n /m "Select Door"
        IF %errorlevel%==1 goto 26
        IF %errorlevel%==2 goto 27
        IF %errorlevel%==3 goto cf%f%
        IF %errorlevel%==4 goto 15
        IF %errorlevel%==5 goto 15
        IF %errorlevel%==6 goto 15
        goto 29

        :cf2
        cls
        0>nul set /p=Floor: # 
        0>nul set /p=Room: #
        echo Moves Remaining: %mr%
        echo Congrats! You have compleated Floor %f%
        set /a f+=1
        echo.
        echo.
        echo You earn an extra 10 turns!
        set /a mr+=10
        pause>nul
        set /a RNG=4*%random%/32768+1
        if %RNG% EQU 1 goto 30
        if %RNG% EQU 2 goto 32
        if %RNG% EQU 3 goto 34
        if %RNG% EQU 4 goto 36

        :30
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 30
        echo Moves Remaining: %mr%
        type r8.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 31
        IF %errorlevel%==2 goto 30
        IF %errorlevel%==3 goto 37
        IF %errorlevel%==4 goto 30
        goto 30

        :31
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 31
        echo Moves Remaining: %mr%
        type r3.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 32
        IF %errorlevel%==2 goto 32
        IF %errorlevel%==3 goto 30
        IF %errorlevel%==4 goto 30
        IF %errorlevel%==5 goto 34
        goto 31

        :32
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 32
        echo Moves Remaining: %mr%
        type r8.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 32
        IF %errorlevel%==2 goto 33
        IF %errorlevel%==3 goto 32
        IF %errorlevel%==4 goto 31
        goto 32

        :33
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 33
        echo Moves Remaining: %mr%
        type r2.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 32
        IF %errorlevel%==2 goto 32
        IF %errorlevel%==3 goto 38
        IF %errorlevel%==4 goto 34
        IF %errorlevel%==5 goto 34
        goto 33

        :34
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 34
        echo Moves Remaining: %mr%
        type r8.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 33
        IF %errorlevel%==2 goto 34
        IF %errorlevel%==3 goto 35
        IF %errorlevel%==4 goto 34
        goto 34

        :35
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 35
        echo Moves Remaining: %mr%
        type r10.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 36
        IF %errorlevel%==2 goto 36
        IF %errorlevel%==3 goto 34
        IF %errorlevel%==4 goto 34
        IF %errorlevel%==5 goto 32
        goto 35

        :36
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 36
        echo Moves Remaining: %mr%
        type r8.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 36
        IF %errorlevel%==2 goto 35
        IF %errorlevel%==3 goto 36
        IF %errorlevel%==4 goto 37
        goto 36

        :37
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 37
        echo Moves Remaining: %mr%
        type r9.maz
        echo.
        echo.
        choice /c abcde /n /m "Select Door"
        IF %errorlevel%==1 goto 36
        IF %errorlevel%==2 goto 36
        IF %errorlevel%==3 goto 30
        IF %errorlevel%==4 goto 30
        IF %errorlevel%==5 goto 36
        goto 37

        :38
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 38
        echo Moves Remaining: %mr%
        type r7.maz
        echo.
        echo.
        choice /c abcdefgh /n /m "Select Door"
        IF %errorlevel%==1 goto 32
        IF %errorlevel%==2 goto 33
        IF %errorlevel%==3 goto 34
        IF %errorlevel%==4 goto 35
        IF %errorlevel%==5 goto 36
        IF %errorlevel%==6 goto 37
        IF %errorlevel%==7 goto 39
        IF %errorlevel%==8 goto 31
        goto 38

        :39
        set /a mr-=1
        if "%mr%"=="0" goto lose
        cls
        0>nul set /p=Floor: %f% 
        0>nul set /p=Room: 39
        echo Moves Remaining: %mr%
        type r8.maz
        echo.
        echo.
        choice /c abcd /n /m "Select Door"
        IF %errorlevel%==1 goto 38
        IF %errorlevel%==2 goto 30
        IF %errorlevel%==3 goto 32
        IF %errorlevel%==4 goto cf%f%
        goto 39

        :cf3
        cls
        0>nul set /p=Floor: # 
        0>nul set /p=Room: #
        echo Moves Remaining: %mr%
        echo Congrats! You have compleated Floor %f%
        set /a f+=1
        echo.
        echo.
        echo You earn an extra 10 turns!
        set /a mr+=10
        pause>nul

        :end
        set /a mr-=1
        cls
        Echo You Win With %mr% Turns Remaining!
        pause>nul
        goto start

        :lose
        echo You Lose!
        pause>nul
        goto start

        r1.maz
        Code: [Select]
        /----B-----C----\
        | |
        | |
        A D
        | |
        | |
        \----F-----E----/
        r2.maz
        Code: [Select]
        \---A---B---\
         \     |
          \ C  |
           \     D
            \       |
             \      |
              \     |
               \    E
                \   |
                 \  |
                  \-/
        r3.maz
        Code: [Select]
        /--A---B--/
        |        /
        D  E    /
        |      /
        |     /
        C    /
        |   /
        |--/
        r4.maz
        Code: [Select]
        /-----B----------C--------D-----\
        | |
        | |
        | |
        A E
        | |
        | |
        | |
        \-----H----------G--------F-----/
        r5.maz
        Code: [Select]
        /--A----B--\
        |    |
        \--D----C--/
        r6.maz
        Code: [Select]
        |--\
        |   \
        A    \
        |     \
        |      \
        B  E    \
        |        \
        \--C---D--\
        r7.maz
        Code: [Select]
            /------A-----\
           /           \
          H    B
         /     \
        /      \
        |      |
        |      |
        G      C
        |      |
        |      |
        \                    / 
         \             /
          F               D
           \              /
            \------E-----/
        r8.maz
        Code: [Select]
        /-A-\
        D   B
        \-C-/
        r9.maz
        Code: [Select]
        |--\
        |   \
        D    \
        |     \
        |      \
        C  E    \
        |        \
        \--A---B--\
        r10.maz
        Code: [Select]
        /--|
          /   |
               /    D
              /     |
             /      |
            /       |
           /        c
          /      E  |
         /          |
        /---A---B---/

        the r#.maz files must be in a dir named "bin". copy them to a text file then use cmd to "rename" them to be .maz

        EDIT: apparently no spoiler support  :'(
        Quote from: patio
        God Bless the DOS Helpers...
        Quote
        If it compiles, send the files.

        Lemonilla



          Apprentice

        • "Too sweet"
        • Thanked: 70
        • Computer: Specs
        • Experience: Experienced
        • OS: Windows 7
        Re: Batch Programs Thread.
        « Reply #553 on: June 10, 2012, 08:21:13 AM »
        to display a % sign you need to echo YOURNUMBER%%%
        example that doesnt work
        Code: [Select]
        @echo off
        pause
        echo 100%
        pause
        echo 30%
        pause
        how to fix said example
        Code: [Select]
        @echo off
        pause
        echo 100%%%
        pause
        echo 30%%%
        pause
        Quote from: patio
        God Bless the DOS Helpers...
        Quote
        If it compiles, send the files.

        shyqyri



          Rookie

          • Experience: Beginner
          • OS: Unknown
          Re: Batch Programs Thread.
          « Reply #554 on: June 10, 2012, 05:01:22 PM »
          dont work this code,,,  :-[
          my project work fine, copy this backup database in network sharing and past in specifik location, but dont show how many minits ore  how % can remainds for this progress.
          databaase backup ore 6 GB.

          thank you.