If the remote disk drive is shared your program sees it essentially as a local drive that is why File.mkdir works.
If the drive is not shared then the mkdir command needs to be executed on a remote system that has the drive mounted (locally or shared).
In unix one way to do it is to use the ssh command probably with a certificate with no password if that meets your security requirements.
If you need to be machine independent you will need some sort of remote procedure call, perhaps a roll your own, which is not hard for something this simple but does require a program to be running on each remote system. I'm not sure of a remote procedure mechanism that works on both Windows and Linux.
It's not what your program can do, it's what your users do with the program.