Advertisement
STGamer24

My first batch program (is in spanish)

Aug 25th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.82 KB | None | 0 0
  1. @echo off
  2. set file=C:\users\%USERNAME%\downloads\Destructive_Game_Save\save.txt
  3. :start
  4. title Inicio
  5. echo 1 - Continuar con el programa normalmente
  6. echo 2 - Ir a una pagina especial
  7. echo 3 - Salir del programa
  8. choice /c 123 /n
  9. if errorlevel 3 exit
  10. if errorlevel 2 goto yt
  11. if errorlevel 1 goto seguir
  12. :yt
  13. cls
  14. start https://www.reddit.com/r/Batch/
  15. exit
  16. :seguir
  17. cls
  18. if exist C:\users\%USERNAME%\downloads\Destructive_Game_Save (
  19. title Creacion del archivo
  20. ) else (
  21. title Creacion de la carpeta
  22. echo No existe la carpeta del programa, deasea creala? [S, N]
  23. choice /c ns /n
  24. if errorlevel 2 goto crearcarpeta
  25. if errorlevel 1 cls
  26. echo Esta bien, nos vemos la proxima
  27. pause >nul
  28. start https://www.youtube.com/watch?v=dQw4w9WgXcQ
  29. exit
  30. )
  31. if exist C:\users\%USERNAME%\downloads\Destructive_Game_Save\save.txt (
  32. title Archivo disponible
  33. echo Hay un archivo de texto disponible, que quiere hacer?
  34. echo 1 - Leerlo
  35. echo 2 - Borrarlo
  36. choice /c 12 /n
  37. if errorlevel 2 goto borrararchivo
  38. if errorlevel 1 goto abrirarchivo
  39. ) else (
  40. echo No existe un archivo legible por el programa, desea crearlo? [S, N]
  41. choice /c ns /n
  42. if errorlevel 2 goto creararchivo
  43. if errorlevel 1 cls
  44. exit
  45. )
  46. pause >nul
  47. exit
  48. :crearcarpeta
  49. mkdir C:\users\%USERNAME%\downloads\Destructive_Game_Save
  50. echo Hola>C:\users\%USERNAME%\downloads\Destructive_Game_Save\save.txt
  51. goto seguir
  52. :creararchivo
  53. cls
  54. echo Hola>C:\users\%USERNAME%\downloads\Destructive_Game_Save\save.txt
  55. goto seguir
  56. :abrirarchivo
  57. cls
  58. title Mostrando Archivo
  59. echo -- Contenido del archivo:
  60. echo.
  61. FOR /f "tokens=*" %%a in (%file%) do (echo %%a)
  62. echo.
  63. echo -- Eso es todo lo que tiene el archivo
  64. pause >nul
  65. cls
  66. goto start
  67. :borrararchivo
  68. cls
  69. title borrando archivo
  70. del C:\users\%USERNAME%\downloads\Destructive_Game_Save\save.txt
  71. echo Archivo borrado exitosamente
  72. pause >nul
  73. exit
Tags: Fun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement