Advertisement
xzlui

Making A Batch Script Code Itself

Nov 3rd, 2017
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.52 KB | None | 0 0
  1. REM ...\scripts\batch\code_me.bat
  2. REM Be sure there is a line break under the ":xzlui" label
  3.  
  4. @echo off
  5. title CodeMe
  6. set this=%cd%\%~n0%~x0
  7. goto main
  8.  
  9. :main
  10. echo Would you like to run your code or continue editing the script?
  11. echo.
  12. echo [1] Add Code
  13. echo [2] Run Code
  14. echo.
  15. set /p cp_opt=$
  16. if %cp_opt%==1 cls && goto add_code
  17. if %cp_opt%==2 cls && goto xzlui
  18.  
  19. :add_code
  20. title CodeMe - Editing %~n0%~x0
  21. set /p in=$
  22. if "%in%" == "/s" set in=:: && goto xzlui
  23. echo %in%>>%this%
  24. set in=::
  25. goto add_code
  26.  
  27. :xzlui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement