how do i save color to a savefile in a batch file on windows 11


  1. Posts : 1
    Windows 11
       #1

    how do i save color to a savefile in a batch file on windows 11


    i have this code

    Code:
    :menu
    color %backroundColor%%textColor%
    cls
    echo 1. Play
    echo.
    echo 2. Load
    echo.
    echo 3. Delete savefile
    echo.
    echo 4. Settings
    echo.
    set /p variable= Write the number of your choice: 
    if %variable% equ 1 goto start
    if %variable% equ 2 goto load
    if %variable% equ 3 goto delete
    if %variable% equ 4 goto settings
    if %variable% neq 1 goto menu
    
    :load
    cls
    set /p savename= What is the name of the savefile you want to load: 
    set /p "page="<%filename%.dat
    if exist %savename%.dat goto saveandload
    echo.
    pause
    goto menu
    
    :save
    cls
    set /p filename= What do you want your savefile to be called: 
    cls
    >%filename%.dat echo %page%
    echo Saved.
    echo.
    pause
    goto meny
    
    :saveandload
    cls
    < %savename%.dat (
    set /p page=
    )
    echo Loaded.
    echo.
    pause
    goto :%page%
    
    :delete
    cls
    set /p delete="Which savefile do you want to delete?: "
    if exist %delete%.dat goto delete1
    cls
    echo It looks like that savefile does not exist.
    echo.
    pause
    goto menu
    
    :delete1
    cls
    echo Are you sure you want to delete %delete%.dat?
    echo.
    echo 1. Yes
    echo.
    echo 2. No
    echo.
    set /p yesno="Write the number of your choice: "
    if %yesno%==1 goto deleteyes
    if %yesno%==2 goto deleteno
    goto radera1
    
    :deleteyes
    cls
    del %delete%.dat
    echo You deleted %delete%.dat
    echo.
    pause
    goto menu
    
    :deleteno
    cls
    echo There is no savefile called %delete%.dat
    echo.
    pause
    goto menu
    
    :settings
    cls
    echo 1. Text- and backroundcolor
    echo.
    echo 2. Go back
    echo.
    set /p variable= Write the number of your choice: 
    if %variable% equ 1 goto textcolor
    if %variable% equ 2 goto menu
    if %variable% neq 1 goto settings
    
    :textcolor
    cls
    echo Textcolor
    echo. 
    echo 1. Black
    echo.
    echo 2. Blue
    echo.
    echo 3. Grean
    echo.
    echo 4. Aqua
    echo.
    echo 5. Red
    echo.
    echo 6. Purple
    echo.
    echo 7. Yellow
    echo.
    echo 8. White
    echo.
    echo 9. Gray
    echo.
    echo 10. Light blue
    echo.
    echo 11. Light grön
    echo.
    echo 12. Light aqua
    echo.
    echo 13. Light red
    echo.
    echo 14. Light purple
    echo.
    echo 15. Light yellow
    echo.
    echo 16. Bright white
    echo.
    echo 17. Go back
    echo.
    echo 18. Menu
    echo.
    set /p variable= Write the number of your choice: 
    if %variable% equ 1 set textColor=0&&goto backroundcolor
    if %variable% equ 2 set textColor=1&&goto backroundcolor
    if %variable% equ 3 set textColor=2&&goto backroundcolor
    if %variable% equ 4 set textColor=3&&goto backroundcolor
    if %variable% equ 5 set textColor=4&&goto backroundcolor
    if %variable% equ 6 set textColor=5&&goto backroundcolor
    if %variable% equ 7 set textColor=6&&goto backroundcolor
    if %variable% equ 8 set textColor=7&&goto backroundcolor
    if %variable% equ 9 set textColor=8&&goto backroundcolor
    if %variable% equ 10 set textColor=9&&goto backroundcolor
    if %variable% equ 11 set textColor=a&&goto backroundcolor
    if %variable% equ 12 set textColor=b&&goto backroundcolor
    if %variable% equ 13 set textColor=c&&goto backroundcolor
    if %variable% equ 14 set textColor=d&&goto backroundcolor
    if %variable% equ 15 set textColor=e&&goto backroundcolor
    if %variable% equ 16 set textColor=f&&goto backroundcolor
    if %variable% equ 17 goto settings
    if %variable% equ 18 goto menu
    if %variable% neq 1 goto textcolor
    
    :backroundcolor
    cls
    echo Backroundcolor
    echo.
    echo 1. Black
    echo.
    echo 2. Blue
    echo.
    echo 3. Grean
    echo.
    echo 4. Aqua
    echo.
    echo 5. Red
    echo.
    echo 6. Purple
    echo.
    echo 7. Yellow
    echo.
    echo 8. White
    echo.
    echo 9. Gray
    echo.
    echo 10. Light blue
    echo.
    echo 11. Light grön
    echo.
    echo 12. Light aqua
    echo.
    echo 13. Light red
    echo.
    echo 14. Light purple
    echo.
    echo 15. Light yellow
    echo.
    echo 16. Bright white
    echo.
    echo 17. Backa
    echo.
    echo 18. Meny
    echo.
    set /p variable= Skriv numret av dit val: 
    if %variable% equ 1 set backroundColor=0&&goto menu
    if %variable% equ 2 set backroundColor=1&&goto menu
    if %variable% equ 3 set backroundColor=2&&goto menu
    if %variable% equ 4 set backroundColor=3&&goto menu
    if %variable% equ 5 set backroundColor=4&&goto menu
    if %variable% equ 6 set backroundColor=5&&goto menu
    if %variable% equ 7 set backroundColor=6&&goto menu
    if %variable% equ 8 set backroundColor=7&&goto menu
    if %variable% equ 9 set backroundColor=8&&goto menu
    if %variable% equ 10 set backroundColor=9&&goto menu
    if %variable% equ 11 set backroundColor=a&&goto menu
    if %variable% equ 12 set backroundColor=b&&goto menu
    if %variable% equ 13 set backroundColor=c&&goto menu
    if %variable% equ 14 set backroundColor=d&&goto menu
    if %variable% equ 15 set backroundColor=e&&goto menu
    if %variable% equ 16 set backroundColor=f&&goto menu
    if %variable% equ 17 goto textcolor
    if %variable% equ 18 goto menu
    if %variable% neq 1 goto backroundcolor
    
    :start
    set page=start
    cls
    echo hello.
    echo.
    echo 1. Save
    echo.
    set /p variable= Write the number of your choice: 
    if %variable% equ 1 goto save
    if %variable% neq 1 goto start
    it can save the page to a .dat file but how do i get it to work so that it also saves the color changes to the same .dat file

    and how do i choose where the .dat file will be saved. i want it to be saved to a map
    Last edited by rune1; 01 Mar 2023 at 04:17.
      My Computer


  2. Posts : 718
    Windows 10 Pro
       #2

    This is a Windows 10 forum dude, pop over to Elevenforums and ask there.
      My Computer


  3. Posts : 16,576
    Windows 10 Home x64 Version 22H2 Build 19045.3930
       #3

    Actually, I suggest you ask whoever gave you that code.
    - You might have to clarify your question before you can get a decent response.

    The answer seems to be that you can choose your desired .dat file each time.
    If you mean that you want it to save to the same .dat file each time without asking you then that requires the code to be edited. Its author is best placed to do that.

    But you also mention saving to a map. I don't know anything about that.


    All the best,
    Denis
      My Computer


  4. Posts : 16,576
    Windows 10 Home x64 Version 22H2 Build 19045.3930
       #4
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:26.
Find Us




Windows 10 Forums