@SpriggsySpriggs Thanks for your reply.
My (second-hand) laptop has, which various 3-rd party software reports as Windows "Enterprise", has Windows 10 x64 Pro build 20H2 and updated up to about a month ago. Sometimes there are some various small differences the way Windows seems to operate (maybe this thread is yet another one) and for instance once I tried to dual install Linux on to it and it really totally crashed my system - worst most complicated reinstall of Windows and files I ever experienced.
With your program I simply entered "J" (no slashes or colon or ") as you might notice from the tiny screenshot above. I had to use the /D switch as part of the "recovery process" as also shown in the screenshot above - essentially in the last screenshot, this is the minimum steps to restore my usb stick back to normal (i tried only as per your last sentence above - but it does not restore for me). I ran both QB64 AND CMD as ADMINISTRATOR for the tests.
A couple of reasons why I want to do it:-
A fair percentage of my usb sticks (I have many different models) run very hot (too hot to touch) but still appear to function properly - to date none have failed or died. Because of my program automated projects these usb sticks may be still connected for days continuously, and I am not always around (or awake), so if the program cycles round to say 3am in the morning to cross-check the usb stick data and only needs 5 minutes connection - I was hoping that shutting down ("ejecting") the usb sticks would allow the HOT ones to cool down (and stay cool) until when and if they are accessed again automatically.
I have "quarantined" a number of usb sticks that were "compromised" when my laptop was infected with a "virus" a year ago. Again automating the process - I am investigating "minimal connect time" of these suspect usb sticks of extracting all the data (and possibly purposely fragmenting the data) - so should a virus be present (it seemed to take windows automatic defender anti-virus about 4 weeks (if my memory serves correct) to eliminate ALL the virus renamed-exe files (that is another story)) So, if automatically a suspect usb stick is only "connected" for say a minute rather than a day - it minimises the opportunity for the suspect usb stick virus (if present) to do damage - it can take a fair while for Windows anti virus to scan the many files on the usb sticks.
Hope this gives you some insight of why the "ejecting" etc (I like the idea of automated programs rather than me manually).
Thanks for all your efforts - at least the first program to eject only will be quite useful - I may have to try out SHELLing the mountvol for the remounting the usb sticks.
I forgot to mention that ALL my drives, except A:\, are FOLDER PROTECTED - so for the first time a new program runs (eg yours) I have to "Allow" the application access to J:\ - but thereafter I don't have to worry. All my results reporting to you was when your program(s) were running from the second time onwards.