I'm writing command line output to a file and then want to open this file in notepad. So I wrote something like the following (simplified example):
set logPath=log.txt
echo %date% %time% > %logPath%
notepad %logPath%
But the problem is that when the last command is run (notepad %logPath%), the file is not yet created (or the contents is not flushed to it), so notepad doesn't open non-existent file or opens an empty one (depends).
So I would like to know if there's a way to force file close from command line.
UPD: thank you for comments, you're right: this particular (simplified) example really does work. I tried on W7 and there are reports in comments that it does work in XP and Vista. It doesn't in the original script, will try to look for an error there.