Batch file 试着做一个批量写作的东西

Batch file 试着做一个批量写作的东西,batch-file,Batch File,所以我试着制作一个bat文件,你首先输入你想要的文本文件,然后输入名字,然后你可以写,在你写了一个百分之一后,你会问我你想不想继续,但我一直被困在每一件事上,从设置/设置问题到变量 我还需要有关创建和命名文件的帮助 @echo off title textfilewriter color a9 echo where do you want your new file? set /p c=input here: cls echo what should it be named? set /p d=

所以我试着制作一个bat文件,你首先输入你想要的文本文件,然后输入名字,然后你可以写,在你写了一个百分之一后,你会问我你想不想继续,但我一直被困在每一件事上,从设置/设置问题到变量

我还需要有关创建和命名文件的帮助

@echo off
title textfilewriter
color a9
echo where do you want your new file?
set /p c=input here:
cls
echo what should it be named?
set /p d=input here:
:start
echo input text and it will go to desierd txt file
set /p a=input here:
>>%c%.txt echo %rfn%
echo input watch and it will bring upp your text file
set /p b=input here:
goto start
if %b%==watch goto watch
:watch
start /wait text.txt
cls
goto start
:reload
start textfilewriter.bat
exit
我知道这件事还没做完,但若有人有时间帮我做这件事,我为什么要寻求帮助


start/wait text.txt它可能会失败,原因有很多(不检查目录是否存在,文件是否可写,是否键入了关键字符,…),但它是一个框架

@echo off
    setlocal enableextensions

    title textfilewriter
    color a9

:start

    cls

    set "where="
    set /p "where=where do you want your new file?"
    if "%where%"=="" goto endProcess

    set "file="
    set /p "file=what should it be named?"
    if "%file%"=="" goto start

:info
    echo.
    echo input text and it will go to the desired txt file
    echo.
    echo input "start" for a new file, "watch" to see saved text or "end" to exit
    echo.

:getLine
    set "line="
    set /p "line=text? :"

    if /i "%line%"=="start" goto start
    if /i "%line%"=="end"   goto endProcess
    if /i "%line%"=="watch" goto dumpFile

    >>"%where%\%file%.txt" echo %line%
    goto getLine

:dumpFile
    echo.
    type "%where%\%file%.txt"
    echo.
    goto info

:endProcess
    endlocal
    exit /b