how to get this working if exist tasklist=="notepad %DATE%.txt" [closed]
- by blade19899
@echo off
title Log file creator
if exist "%CD%\%DATE%.txt" (msg * "the log of today(%DATE%.txt) Has already been made" goto :notepad) else (goto :start)
goto :eof
:start
echo %date%>>"%date%".txt
echo %username% >>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo ----------------------------------------Reports---------------------------------------- >>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
echo ----------------------------------------TO-DO---------------------- >>"%date%".txt
echo.>>"%date%".txt
echo.>>"%date%".txt
:notepad
if exist tasklist=="notepad %DATE%.txt" (msg * "the log of today(%DATE%.txt) Has already been made, en is opened") else (goto :start)
goto :eof
:start
start notepad %DATE%.txt
This code right now pops up the log of today(%DATE%.txt) Has already been made and after clicking OK it doesn't do anything it should open the msg the log of today(%DATE%.txt) Has already been made, en is opened i have notepad opened. with process explorer it shows
notepad and the date.txt
my question is how to make it show the the log of today(%DATE%.txt) Has already been made, en is opened box... and perhaps bring notepad to the foreground?
ps not sure if this question belongs here. Apologize if it doesn't!