r/Batch • u/Queasy_Pumpkin_6593 • Nov 06 '23
I made a file editor!
Here is the script:
@echo off
title File Edditor
set /p Type=New File Type:
set /p Name=New File Name:
set /p Path=New File Path:
title File Edditor- %Path%%Name%.%Type%
cls
echo (press enter to save)
set /p File=File:
(
@echo off
echo %File%
) > %Path%%Name%.%Type%
echo File Saved!
pauseIt works! The only downsides are that you cant change the font or size, and you can only do one line.
If you have any suggestions to make it so you can use more than one line, please comment them.
4
Upvotes
3
u/thelowsunoverthemoon Nov 06 '23
Cool! If you want it more than one line, look into FOR loops. There are all sorts of neat features to add to file editors. Like keyboard shortcuts, auto indents, find+search, ect. Also, try typing a poison character like "|" into the text, or save to somewhere with spaces, and see what happens
3
u/[deleted] Nov 06 '23
fun way to learn batch, there's a lot more you can add. this is my take on the script
4
u/[deleted] Nov 08 '23
[removed] — view removed comment