the PS1 script will execute itself thus open Mp3tag and load the files - instead of opening itself for editing in Notepad. Unfortunately this combination will override the basic principal of the script, because it will open Mp3atg in a minimized only if it has been closed in such viewing mode. So the Mp3ag ebery time would have to be closed "properly" by the user during the previous system session
And on top of that this automatically executed LNK file will leave a window open with
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
[this is the code provided kindly by @LyricsLover with my crucial addition to it of the playlist file]
4] Save it as X.ps1 in the same location; i.e. C:\Various Scripts\
And what do you get? A working as intended PS1 script plus a BAT executing that PS1. Running by hand either of them opens Mp3tag in a minimized form, with files loaded to it that are listed in the My Playlist.m3u8 file. Of course that BAT is useless without that PS1 - but that BAT can be used further, right?
Yes and no. The bottom line is:
whatever workaround is put in C:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup - it will open Mp3tag window in maximized / last used size
I tried adding another another BAT to the equation, putting a delay in them [with the timeout parameter], using them directly or via a LNK file - and the result is always the same: such chains run automatically at startup will in the end ignore the request for minimized Mp3tag window; while re-run [executed] by hand will take it seriously and open Mp3tag minimized. So the very same files behave differently. I also tried out briefly a free piece of sotware AdvancedRun v1.22 by Nir Sofer, but [suprise suprise!] it had the same issue- of ignoring the minimize / hidden parameter
And so
it seems safe to make and educated guess that even if I somehow managed to run that PS1 script without a BAT intermediary, it would ignore the request for minimization - and so it would not do the job. And I have an argument for that
Because after failing with BAT approach I went after all to TaskScheduler and created a Task with Action parameters set to [after numerous failures] as
Program / script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional): -ExecutionPolicy Bypass -File "C:\Various Scripts\X.ps1"
Start in (optional): C:\Various Scripts\
and told the Task to run at log-on
And once again the dichotomy repeats itself: when this Task is executed by hand [i.e. from within TaskSheduler] it opens Mp3tag in minimized form - but when the Task is executed as planned [after a reset of the system] it ignores the the minimization request residing in the PS1 file
The only little advantaged I have gained by using the TaskScheduler is that apparently its items are run even before items from C:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. In my particualr sett-up it means that my maximized FreeCommander window opens itself after Mp3tag thus obscuring it. But I just cannot relay on this workaround to a workaround, as it is could somehow break itself [i.e. start executing FreeCommander before Mp3tag]. [Plus the big white window of Mp3tag flashes itself - I would not like that when working at night]
And I finally have an apparently good enough and relatively easy
to utilize as part of my C:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
I took the -ExecutionPolicy Bypass -File part from the Task I was exploring previously and I added it to a LNK file. So now in the folder Startup I have a shortcut leading to that PS1 file with code
And it works; in that after entering Windows Mp3tag will be executed by X.ps1 file [which was a problem - to automatically execute PS1 file and not just open it for editing] with the particular playlist will being loaded to Mp3tag. Although the window of Mp3tag will be open maximized, it will be somehow opened under [behind] the window of FreeCommander, which is set to open also in a maximized form and also by the means of having in folder Start a LNK file leading to its EXE
And I said somehow, because there is no logic here. The C:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup apparently works by alphabetical order- whatever is at the top will be loaded [executed] first. So FreeCommander XE.lnk is executed first and only after it an another process happens- of the X.lnk. So Mp3tag should be placed on top of FreeCommander window - but it is not. And yes I have made an experiment- by renaming X.lnk to ! X.lnk I made this file appear above FreeCommander XE.lnk in the folder Start- and thus made it to be executed as the first item from Start. And the result was that Mp3tag was opened with focus [at the front] - and this is the exact opposite of what should be happening [because FreeCommander window should be placed over it]
But what is more, when I went back to re-naming it as X.lnk but also changed its parameter Run: from Normal window to Minimized it also started running in front of FreeCommander window. So once again ladies and gentlemen the minimized parameter from "Start" folder was ignored - apparently on the account of being evoked from Startt folder; plus it broke the workaround
All in all, this method with LNK file is also better than TaskSchduler approach because it does not create a brief appearance of the Mp3tag window - it stays hidden behind FreeCommander [while the TaskScheduler method made a quick flash of Mp3tag window]
So for now this seems to be the solution
But first it is applicable only in peculiar circumstances [of having some third party software auto-running concurrently which happens to be able to hide Mp3tag window]. And secondly I simply do not like the idea to be forced to
And so, if someone has other solutions / ideas - please post them here, even in a distant future
And of course it broke; because of me doing some software update
Long story short: in order to fix it, the user apparently has to do the whole process from scratch - i.e. once more create a proper LNK file for PS1 script and place it in the Start folder thus deleting the old shorcut
Thus