I've found an one-liner that should eject my USB stick when used in cmd window:
powershell -command "(New-Object -comObject Shell.Application).NameSpace(17).ParseName('F:').InvokeVerb('Eject')"
This unfortunately doesn't work on my machine. It just outputs an empty line. I've somehow found out that if I add the "-noexit" switch to the code, it works perfectly.
powershell -noexit -command "(New-Object -comObject Shell.Application).NameSpace(17).ParseName('F:').InvokeVerb('Eject')"
However, I want it to execute seamlessly. Is there any way to fix it?