onedrive云盘是微软推出的云储存空间服务,相比于百度云,没有会员限制,有着较快的下载上传速度。采用Rclone软件可将onedrive映射为电脑本地,成为电脑上的一个(云)磁盘空间,便于使用,且Rclone支持全平台,能够在不同操作系统上对onedrive进行挂载。

本文主要介绍win10下使用Rclone将OneDrive映射到本地磁盘,并且实现了win10系统开机自动挂载,有效解决了电脑重启后onedrive挂载盘丢失需要重新手动挂载的问题。

最终得到的效果如图所示(5T onedrive磁盘)

下载rclone,winfsp和Git bash

首先需要下载和安装挂载所需的软件和辅助工具。

一共有3个:

Rclone:https://github.com/rclone/rclone/releases

Winfsp:https://github.com/billziss-gh/winfsp/releases

Git bash:https://gitforwindows.org/

Rclone.

点击链接进入下载网址,可以看到有许多不同的版本,适用于Windows系统有rclone-v1.51.0-windows-amd64.zip和rclone-v1.51.0-windows-386.zip,根据自己电脑是64位的还是32位的对应选择合适的压缩包下载。
我的电脑是64位的系统,所以下载红框圈出的压缩包,rclone-v1.51.0-windows-amd64.zip

下载完成之后,将压缩包解压到一个全英文的目录下,例如我解压到了D:\Program Files\rclone-v1.51.0-windows-amd64

Winfsp. 和 Git bash.

下载之后直接安装即可,无需修改安装位置,一路按默认的点下去就可。

考虑到github网站下载速度较慢,我将上述Rclone和Winfsp的安装文件下载好之后,放在网盘里分享出来供大家使用。

链接:https://pan.baidu.com/s/1g3OxTiuIr2b86w2-zq5liA
提取码:hksx

配置Rclone

安装好这几个软件后,开始配置Rclone。

  1. 首先修改windows系统的环境变量,将rclone的路径添加到path中:
    在桌面上右键点击此电脑标志,然后点击属性->高级系统设置->环境变量->系统变量->Path

    添加rclone文件夹的路径到path中,我电脑上rclone放置的路径在D:\Program Files\rclone-v1.51.0-windows-amd64
    2. 修改好环境变量之后,打开windows powershell,配置rclone.config。

按键盘上的win+x,然后按a键,即可调出windows powershell

输入rclone --version,可查看rclone是否成功安装。

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。 尝试新的跨平台 PowerShell https://aka.ms/pscore6 PS C:\Windows\system32> rclone --version

rclone v1.51.0

- os/arch: windows/amd64

- go version: go1.13.7
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

查看成功安装rclone后,输入rclone config,配置要加载的onedrive信息,按照下面的步骤依次进行下去。

PS C:\Windows\system32> rclone config  (步骤1. 输入rclone config)
2020/04/25 13:29:37 NOTICE: Config file "C:\\Users\\dell\\.config\\rclone\\rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n (步骤2. 输入n,表示新建配置)
name> onedrive (步骤3. 命名为"onedrive",也可取其他的名字,但要与下面所使用的名字保持一致)
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
\ "fichier"
2 / Alias for an existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / In memory object storage system.
\ "memory"
17 / JottaCloud
\ "jottacloud"
18 / Koofr
\ "koofr"
19 / Local Disk
\ "local"
20 / Mail.ru Cloud
\ "mailru"
21 / Mega
\ "mega"
22 / Microsoft Azure Blob Storage
\ "azureblob"
23 / Microsoft OneDrive
\ "onedrive"
24 / OpenDrive
\ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
26 / Pcloud
\ "pcloud"
27 / Put.io
\ "putio"
28 / QingCloud Object Storage
\ "qingstor"
29 / SSH/SFTP Connection
\ "sftp"
30 / Sugarsync
\ "sugarsync"
31 / Transparently chunk/split large files
\ "chunker"
32 / Union merges the contents of several remotes
\ "union"
33 / Webdav
\ "webdav"
34 / Yandex Disk
\ "yandex"
35 / http Connection
\ "http"
36 / premiumize.me
Storage> 23 (步骤4. 输入数字23,因为Microsoft OneDrive对应的类型是23)
** See help for onedrive backend at: https://rclone.org/onedrive/ ** Microsoft App Client Id

Leave blank normally.

Enter a string value. Press Enter for the default ("").

client_id> (步骤5. 按enter键跳过)

Microsoft App Client Secret

Leave blank normally.

Enter a string value. Press Enter for the default ("").

client_secret> (步骤6. 按enter键跳过)

Edit advanced config? (y/n)

y) Yes

n) No (default)

y/n> n (步骤7. 输入n,采用默认设置)

Remote config

Use auto config?

Say Y if not sure

Say N if you are working on a remote or headless machine

y) Yes (default)

n) No

y/n> y (步骤8. 输入y,采用默认设置)

If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=lcvcDmCLf1ugmaCzlEtMSA

Log in and authorize rclone for access

Waiting for code...

----------------------------------

(步骤8执行后会跳转到Microsoft OneDrive账号登录界面和授权界面,登录后在授权请求界面点击“是”)

-----------------------------------

Got code

Choose a number from below, or type in an existing value

1 / OneDrive Personal or Business

\ "onedrive"

2 / Root Sharepoint site

\ "sharepoint"

3 / Type in driveID

\ "driveid"

4 / Type in SiteID

\ "siteid"

5 / Search a Sharepoint site

\ "search"

Your choice> 1 (步骤9. 输入1,数字1对应OneDrive Personal or Business)

Found 1 drives, please select the one you want to use:

0: (personal) id=cdffcd6a2a3dc176

Chose drive to use:> 0 (步骤10. 输入0,数字0对应OneDrive个人版)

Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=cdffcd6a2a3dc176

Is that okay?

y) Yes (default)

n) No

y/n> y 0 (步骤11. 输入y,采用默认设置)

--------------------

[onedrive]

type = onedrive

token = {"access_token":"(隐私信息省略)

drive_id = (隐私信息省略)**


drive_type = personal

--------------------

y) Yes this is OK (default)

e) Edit this remote

d) Delete this remote

y/e/d> y (步骤12. 输入y)

Current remotes: Name Type

== ==

onedrive onedrive e) Edit existing remote

n) New remote

d) Delete remote

r) Rename remote

c) Copy remote

s) Set configuration password

q) Quit config

e/n/d/r/c/s/q> q (步骤13. 输入q,退出)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156

完成rclone配置后,挂载onedrive磁盘。
在git中输入如下命令并执行(注意,末尾的&很重要,不加&的话退出git则挂载就失效了):

rclone mount onedrive:/ E: --cache-dir D:\Onedrive --vfs-cache-mode writes &
  • 1

到这一步,就可以在电脑上看到多出一个onedrive(E)磁盘。

但还没有结束,还需要解决电脑重启后挂载失效的问题。

开机自动挂载

采用开机自动挂载的方式,可有效解决电脑重启后onedrive磁盘消息的问题,省去重新手动挂载的麻烦。

新建两个文件,分别为rclone.bat和rclone.vbs

  1. rclone.bat中写入上述挂载命令:
rclone mount onedrive:/ E: --cache-dir D:\Onedrive --vfs-cache-mode writes &
  • 1
  1. rclone.vbs设置开机自动调用cmd运行rclone.bat文件并退出cmd,写入如下代码:
CreateObject("WScript.Shell").Run "cmd /c D:/rclone.bat",0
  • 1

将rclone.bat文件放到D盘(或其他的盘)目录下,我放在了D盘,所以在rclone.vbs中该文件的路径就是D:/rclone.bat

将rclone.vbs文件放到windows系统启动项目录下,在文件夹的路径框中输入
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
即可进入启动项目录

至此,onedrive磁盘的挂载完成,且电脑下次开机时onedrive磁盘也不会消失

</article>

[转帖]win10下使用Rclone将OneDrive映射到本地磁盘教程(开机自动挂载)的更多相关文章

  1. CentOS 7 下挂载NTFS文件系统并实行开机自动挂载

    CentOS 7 下想要挂载NTFS的文件系统该怎么办呢? 我们需要一个NTFS-3G工具,并编译它之后在mount就可以了,就这么简单. 首先要进入官网下载NTFS-3G工具 http://www. ...

  2. Linux下如何挂载文件,并设置开机自动挂载

    首先保证服务端安装了 查看是否安装命令: nfsstat yum install nfs-utils 安装nfs-utils 192.168.50.85(服务端)192.168.50.83(客户端) ...

  3. ubuntu下设置开机自动挂载硬盘

    我们在linux中常常用mount命令把硬盘分区或者光盘挂载到文件系统中./etc/fstab就是在开机引导的时候自动挂载到linux的文件系统. 如果给计算机配了一块新磁盘,已经分区,格式化,挂载, ...

  4. CentOS 7 下挂载NTFS盘及开机自动挂载

    一.工具 NTFS-3G 二.安装2种安装方式 2.1.yum安装 yum install NTFS* 2.2.编译安装 下载 解压 wget https://tuxera.com/opensourc ...

  5. virtualbox下ubuntu共享文件夹自动挂载

    1.若想删除挂载,可执行命令 umount -f /mnt/share 2.若想开机自动挂载,可以在 /etc/fstab 文件末添加一项     sharing /mnt/share vboxsf  ...

  6. Ubuntu安装配置rclone(Onedrive应用)

    rclone安装 命令行安装 脚本安装 curl https://rclone.org/install.sh | sudo bash # 或者 curl https://rclone.org/inst ...

  7. win10 下visual studio 2015 在调试模式下不能跟踪源文件

    win10 下visual studio 2015 在调试模式下不能跟踪源文件,只要一调试就会关闭(隐藏)打开的文档,非常不方便.经过一番折腾,发现是配置的问题. 如果安装多个版本的VS,请删除对应版 ...

  8. win10下的使用

    一.win10下使用win7那样的图片查看器快些. 打开图片的设置,关闭自动增强我的图片 二.查看win10秘钥 1.打开注册表,依次定位:HKEY_LOCAL_MACHINE/SOFTWARE/Mi ...

  9. Win7/Win8/Win8.1/Win10下的DragEnter DragDrop事件不触发

    Win7/Win8/Win8.1/Win10下的DragDrop事件不触发 2011-02-02  来自:博客园  字体大小:[大 中 小] 摘要:你的应用程序需要从windows资源管理器拖动文件到 ...

  10. Win10下Android studio配置

    Win10下Android studio配置 一.安装Android Studio的准备工作 1.下载好JDK,去官网上找一个下载下来 2.安装JDK.并配置环境变量.安装过程:本人将使用的是jdk- ...

随机推荐

  1. Spring 中循环依赖的处理

    Spring 提供了十分强大的依赖注入功能,使得我们不再需要手动去管理对象的依赖项.然而,在实际的使用场景中,可能会遇到类似下面的依赖异常: Exception encountered during ...

  2. KubeEdge边缘计算在顺丰科技工业物联网中的实践

    摘要:顺丰物联网平台负责人胡典钢为大家带来了 " 边缘计算在工业物联网中的应用实践与思考 " ,阐述了工业物联网的发展背景.整体架构设计以及边缘计算在此过程中承担的重要角色,并梳理 ...

  3. 再获信通院权威认证,优等生华为云GaussDB数据库凭什么?

    摘要:在八大项测试中,华为云 GaussDB的两款数据库都以优异的成绩通过.那么这两款数据库究竟是凭借什么获此殊荣呢? 近期,中国信通院公布了第十三批数据库产品基础能力.性能和稳定性评审结果.在本次评 ...

  4. appuploader   iOS 应用自动发布

    appuploader是一款专门为 iOS 和 Android 开发人员设计的自动化工具,可以帮助开发人员轻松解决一些繁琐的任务,例如生成屏幕截图.处理配置文件和发布应用程序等.这个工具可以让开发人员 ...

  5. Docker 与 Linux Cgroups:资源隔离的魔法之旅

    这篇文章主要介绍了 Docker 如何利用 Linux 的 Control Groups(cgroups)实现容器的资源隔离和管理. 最后通过简单 Demo 演示了如何使用 Go 和 cgroups ...

  6. 【django-vue】七牛云上传视频 搜索接口 支付宝sdk二次封装 下单接口 前端支付页面 支付成功回调接口

    目录 上节回顾 课程详情接口 choice字段 今日内容 1 文件存储 1.1 七牛云上传文件 2 搜索导航栏 2.1 Header.vue 3 搜索接口 4 搜索页面 5 支付宝支付介绍 5.1 支 ...

  7. Windows下的Linux子系统(WSL)

    什么是WSLWSL:Windows subsystem for Linux,是用于Windows上的Linux的子系统作用很简单,可以在Windows系统中获取Linux系统环境,并完全直连计算机硬件 ...

  8. HTML5 postMessage 跨域跨窗口传递消息

    父页面代码: <!DOCTYPE html> <html> <head> <title>选择位置demo</title> <meta ...

  9. Markdown 语法:高级技巧

    Markdown 高级技巧 支持的 HTML 元素 不在 Markdown 涵盖范围之内的标签,多可以直接在文档里面用 HTML 撰写. 目前支持的 HTML 标签有 <kbd>,< ...

  10. vivo悟空活动中台 - 微组件多端探索

    本文首发于 vivo互联网技术 微信公众号 链接: https://mp.weixin.qq.com/s/oGX4XSm8F4fa1ocLdpyqlA作者:悟空中台研发团队 [悟空活动中台]系列往期精 ...