@echo off if "%1"=="" goto mt if "%1"=="/F" goto fileit if "%1"=="/?" goto helpme if "%1"=="/N" goto make :nofileit set dfile=%1 shift set stringy=%1 shift :nfipo set stringy=%stringy% %1 shift if "%1"=="" goto done goto nfipo :fileit rem Quote from original /? text: rem echo To append the contents of a file instead of a line of text, use the parameter rem echo /F, e.g. "append /F C:\notes.txt C:\stuff\note3.txt". echo. echo I'm sorry. This feature is not available in this version. If you would echo like the latest version of append.bat (which probably includes this feature), echo then please contact me via email at the following address: echo DSRfeedback@yahoo.com echo. pause goto finit :helpme echo _______________________________________________________________________________ echo A P P E N D echo by Damien Riegel echo. echo Program for appending text to a file from the command line. echo. echo append {file} {text} echo Example: "append C:\notes.txt The event has been changed to 2:00." echo. echo If you find this program useful, please tell me so at DSRfeedback@yahoo.com. echo. echo You can find similar handy, simple command line tools at dsr.rewound.net. echo. goto finit :mt echo. echo. echo APPEND echo Program for appending text to a file from the command line. echo. echo ERROR: parameters required. echo Type "append /?" for help. echo. goto finit :make rem Quote from original /? text: rem echo To tell "append" to install a new batch file called "note", use the rem echo parameter /N, e.g. "append /N". echo. echo "Note" basically appends the specified text to C:\notes.txt. It has its own echo help file that can be accessed once it's installed. echo. echo I'm sorry. This feature is not available in this version. If you wish to echo obtain "note.bat", tell me. I can be contacted via email at the following echo address: echo DSRfeedback@yahoo.com echo. pause goto finit :done echo %stringy% > temporar.yhi copy %dfile% temporar.yh3 REM If on Windows XP, you can just use "type %dfile% temporar" etc., but on REM older operating systems, "type" can't use more than one file, so you need REM to use my ANDD program instead, so if ANDD is in the EXE search path REM named "a.bat", you can instead use "call a type %dfile% and type REM temporar.yhi {key above period} temporar.yh2". If you try to use the XP format on an older REM operating system, it will accidentally delete %dfile%. The only way to REM stop this accidental deletion is to check to make sure temporar.yh2 is REM larger than 0 bytes, or to scan for errorlevel after the "type" command is REM issued. Unfortunately, I don't know errorlevel codes and (to my knowledge) REM you can't perform "if" relative to filesize. This version uses "a.bat", but REM a version that required XP but not "a.bat" could easily be made by changing REM the line below. REM I have taken another precaution by precopying %dfile% to temporar.yh3 (see REM line above this bunch of REM's). REM type %dfile% temporar.yhi > temporar.yh2 REM Update: it doesn't work to use ANDD in this program, but fortunately there is REM another way: simply do `"copy "a.txt"+"B.txt" "3.txt"'. copy "%dfile%"+"temporar.yhi" "temporar.yh2" if exist temporar.yh2 copy /Y temporar.yh2 %dfile% if not exist temporar.yh2 echo Error - Temporary File 2 does not exist! Contact me at DSRfeedback@yahoo.com. echo. echo _________________________________________________________________________ echo. echo Successfully appended line to "%dfile%". echo %dfile%: echo _________________________________________________________________________ type %dfile% if exist %dfile% del temporar.yhi if exist %dfile% del temporar.yh2 if exist %dfile% del temporar.yh3 echo. if not exist %dfile% echo %dfile% does not exist! Temporary files have not been deleted. if not exist %dfile% echo The line you typed has been saved to "appendb1.txt" and the contents if not exist %dfile% echo of the file has been saved to "appendb2.txt" and/or "appendb3.txt". if not exist %dfile% echo If this error was caused by the program and not by you, please contact if not exist %dfile% echo me at DSRfeedback@yahoo.com. Thank-you. if not exist %dfile% ren temporar.yhi appendb1.txt if not exist %dfile% ren temporar.yh2 appendb2.txt if not exist %dfile% ren temporar.yh3 appendb3.txt :finit