Answer the question
In order to leave comments, you need to log in
How to force .bat file to create .html file and open it?
How can I have my run.bat create a {Random 5 letter}.html file and open it on the screen?
Like I click on the batch file, it immediately creates the {Random set of 5 letters}.html file, it will turn out like 6fe6c.html and the batch file will immediately open it as the user opens it on his own, but this time the batch file itself should create and open the file automatically on the screen.
@echo off
set OUTPUT=www.html
if "%STDOUT_REDIRECTED%" == "" (
set STDOUT_REDIRECTED=yes
cmd.exe /c %0 %* >%OUTPUT%
exit /b %ERRORLEVEL%
)
echo ^<html^>
echo ^<head^>
echo ^<title^>This is a greeting page^</title^>
echo ^</head^>
echo ^<body^>
echo Hello World!
echo ^</body^>
echo ^</html^>
echo ^<!== Its your page :D ==>^>www.html
more www.html
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question