duplicate .txt file opened. Why? How can I fix this?

Started by pguild, April 19, 2024, 06:47:35 PM

Previous topic - Next topic

pguild

I give a simple command like

Run("Notepad",filename)
Note that filename is a valid file with a ".txt" extension in the current directory.

Notepad runs but two copies of the file appear. Why? How do I fix this?
Before running that command I check to make sue that the filename does not exist
with:
If WinExist(filename) == @FALSE
   Run("Noteopad",filename)
Endif
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer

td

MSFT has been updating Notepad.exe with multiple "enhancements" since it was rewritten as a UWP application. The answer to your "how to fix it" question likely depends on how current your version of Notepad is. On my system, I have the settings option (the gear graphic on the right-hand side of the menu bar) When Notepad starts set to Open new window. This causes a new instance of Notepad to start with a single tabbed window.  If I set it to Open content from previous session, I get a single instance of Notepad with 2 open table windows. Notepad also has the option Opening files. That can be set to Open in new tab or Open in new window.

You might see how some combinations of the above options could produce the effect you are witnessing. But as mentioned how that all plays out may depend on how up-to-date your version of Notepad is.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

pguild

Thanks Winbatch Tech Support! Setting Notepad to "Open in new tab" worked well.
www.DogTrainingPsychology.com -- "Don't wish it were easier, wish you were better."  as aphorism by Jim Rohn as quoted in the Kindle Book, GEMS OF WISDOM by Philip Seyer