

When executing you are prompted to enter your Windows OneDrive password (you can as well hardcode it in the net use call to avoid the prompt, but that is not recommended for obvious security concerns).Īfter that you have OneDrive mounted as network drive which now shows up in Windows Explorer and can by easily accessed with shell commands, like synchronization copy backup operations: robocopy C:/mydatalocal Y:/mydataonedrive /MIR

Y: OneDriveCID is your OneDrive ID which you see when you log into OneDrive via a Browser (the URL comes back as something like ) and OneDriveUser is your Windows OneDrive user name (usually something like so this could look like: net use Y: "" /P:No Whereas OneDriveMoutPoint is a free windows drive letter you like use, e.g. This is how I do it in a classcial windows BAT shell script: You first map OneDrive as a standard Windows net work drive, and then perform operations on it: net use OneDriveMountPoint "" /USER:OneDriveUser /P:No
