Q:

Why does batch script crash without an error code?

I'm trying to make an interface to make an split screen html file but there's a bug which doesn't return an error code
@echo off
color 1a
echo welcome to split screen creator - made by Tijmen
pause
cls
set /p file= type here the file name:
set /p links= left page:
set /p rechts= right page:
TimeOut 1 > nul
cls
echo generating
echo.>%file%.html <html><head><title>
echo.>%file%.html %file%
echo.>%file%.html </title></head>
echo.>%file%.html <frameset bordercolor="black" noresize
scrolling="auto" cols="%40, %40">
echo.>%file%.html <frame src="
echo.>%file%.html %links%
echo.>%file%.html ">
echo.>%file%.html <frame src="
echo.>%file%.html %rechts%
echo.>%file%.html ">
echo.>%file%.html </frameset>
echo.>%file%.html </html>
cls
echo ready
pause

A:

You need to escape some of the characters you are writing to the file.
Generating html with batch .. escape quotes
For example, instead of this:
echo.>%file%.html <html><head><title>
echo.>%file%.html %file%
echo.>%file%.html </title></head>
echo.>%file%.html <frameset bordercolor="black" noresize
scrolling="auto" cols="%40, %40">

Try this:
echo ^<html^>^<head^>^<title^> > %file%.html
echo %file% >> %file%.html
echo ^</title^>^</head^> >> %file%.html
echo ^<frameset bordercolor="black" noresize scrolling="auto" cols="%%40, %%40"^> >> %file%.html

