拥有专用于Windows 操作系统的小型(Windows operating)SSD最令人沮丧的部分之一是,某些软件安装程序根本不会让您选择在主驱动器之外进行安装。
甚至有一些应用程序允许您将安装数据存储在辅助驱动器上,但仍将临时文件或缓存文件放在主驱动器上。对于任何有兴趣保持主驱动器整洁(drive nice and tidy)的人来说,这可能是一个主要问题。
Spotify是
您最终会发现占用大量空间的众多Windows应用程序之一。(Windows)这是由于Spotify在本地缓存您的数据的方式,这样您就不会经常从他们的服务器上重新传输音乐。它是
Spotify节省带宽并立即传送您的音乐而无需缓冲的一种方式。
但是,对于我们这些试图节省宝贵磁盘空间(disk space)的人来说,这是有代价的。不是每个人都能负担得起在他们的主驱动器上拥有几 GB 的本地Spotify数据,好消息是有办法解决它。让我们谈谈如何将Spotify的本地缓存数据移动到Windows中的新位置。
如何
在Windows中更改(Windows)Spotify 数据的位置(Spotify Data)
要执行此任务,我们将使用称为符号链接或目录连接的东西。目录连接有效地在一个文件路径上创建数据的镜像,但实际上将数据存储在另一个文件路径中。(file path)
我们需要做的第一件事是准确找到我们的 Spotify 数据文件夹的实际位置。为此,请按Windows + R键以显示
运行提示(Run prompt)。在这里,输入“ %localappdata ”并按Enter。
这应该会在您的Windows 用户(Windows user)配置文件位置(profile location)
中打开AppData\LocalWindows 资源管理器窗口(Windows Explorer window)。在此文件列表中,找到Spotify文件夹并将其打开。
其中的Data
文件夹包含所有缓存的音乐数据。您可能需要右键单击它并选择“属性(Properties)
”以查看该文件夹的大小。它是否太大以至于您想将其从当前驱动器上移到另一个驱动器上?伟大的!这就是我们接下来要做的。
第一步是确保Spotify当前未在您的计算机上运行。确保它已关闭后,您要选择Data文件夹并按Ctrl + C键复制它。
接下来,打开您要移动Spotify 数据的位置的第二个(Spotify data)Windows 资源管理器窗口(Windows Explorer window)。在该位置,按Ctrl + V粘贴文件夹。
(Above)在上图中,您可以看到我在D:\craig\Spotify创建了一个新位置来存储我的数据。此处粘贴的Data文件夹包含C:\Users\craig\AppData\Local\Spotify中同一文件夹的内容。
接下来,确保两个文件夹相同。查看它们两个内部,看看您是否已正确复制所有文件。完成后,返回原始Spotify 文件夹位置(folder location)(在我们的第一个Windows 资源管理器窗口(Windows Explorer window)中的AppData\Local),选择我们刚刚复制的Data文件夹,然后按(Data)Delete键将其删除。
接下来,我们将创建一个目录联结,以便您的新数据(Data)
文件夹指向旧文件夹曾经所在的位置。为此,请按Windows + R键再次调出
运行提示(Run prompt)。输入“ cmd ”,但一定要按Ctrl + Shift + Enter
(而不仅仅是Enter )——这会以(Enter)Administrator身份运行提示。
这是我们将开始创建目录连接的地方。您要输入以下命令:mklink /j <link> <target>,其中<link>是原始文件夹的路径(我们正在重新创建),而<target>是新文件夹的路径(即我们已经粘贴)。
在上面的示例中,我将运行以下命令:mklink /j
C:\Users\craig\AppData\Local\Spotify D:\craig\Spotify
如果文件夹路径包含空格,则用引号将其括起来很重要。
创建目录连接(directory junction)后,
您将看到一条成功消息(success message)。您还应该看到Data文件夹现在再次出现在我们原来的位置,这次在左下角有一个小的“快捷方式”图标。(” icon)
而已!现在,当您在
Spotify中播放音乐时,它仍会将该数据缓存在您链接位置的原始文件夹中。但是,目录连接(directory junction)会自动将其移动到新位置并将其“镜像”到原始位置。
对于那些每天使用Spotify的人来说,多年的常规使用可能会导致这个文件夹膨胀到一个巨大的大小。使用这个简单的目录连接技巧(directory junction trick),您可以将所有数据存储在任何驱动器上的任何文件夹中。
最重要的是,同样的过程在许多其他有用的场景中也很有用——看看我们如何使用符号链接将文件夹同步到Dropbox 和 OneDrive(Dropbox and OneDrive)!
How to Change the Location of Spotify’s Local Storage in Windows
One of the most frustrating parts of having a
small SSD dedicated to your Windows opеrating system is the fаct that ѕome
software installers sіmply won’t give you the option оf installing outside of
the primаry drive.
There are even some applications that allow
you to store your installation data on a secondary drive but still place
temporary or cache files on the primary drive. For anyone interested in keeping
their primary drive nice and tidy, this can be a major issue.
Spotify is one of the many Windows
applications that you’ll eventually find taking up a whole mess of space. This
is due to the way Spotify locally caches your data so that you aren’t
constantly re-streaming music off of their servers. It serves as a way for
Spotify to save bandwidth and instantly deliver your music without needing to
buffer.
However, this comes at a price for those of us
trying to save precious disk space. Not everyone can afford to have several
gigabytes of local Spotify data on their primary drive, and the good news is
that there’s a way around it. Let’s talk about how you can move Spotify’s local
cache data to a new location within Windows.
How to Change the Location of
Spotify Data in Windows
To perform this task, we’re going to use
something called a symbolic link or directory junction. A directory junction
effectively creates a mirror of your data at one file path but actually stores
the data in another.
The first thing we’re going to need to do is
to find exactly where our Spotify’s data folder actually is. To do so, press
the Windows + R keys to bring up a
Run prompt. Here, type in “%localappdata”
and press Enter.
This should bring up a Windows Explorer window
of the AppData\Local folder within
your Windows user profile location. In this list of files, find the Spotify folder and open it.
The Data
folder within is what contains all of your cached music data. You may want to
right-click on it and select Properties
to see how large this folder is. Is it so big that you’d like to move it off of
your current drive and onto another? Great! That’s what we’re going to do next.
The first step is to be sure that Spotify is not currently running on your machine. After making sure that it’s closed, you want to select the Data folder and press the Ctrl + C keys to copy it.
Next, bring up a second Windows Explorer window of the location where you want to move your Spotify data. At that location, press Ctrl + V to paste the folder.
Above, you can see that I’ve created a new
location to store my data at D:\craig\Spotify.
The pasted Data folder here contains
the contents of that same folder in C:\Users\craig\AppData\Local\Spotify.
Next, be sure that the two folders are
identical. Look inside both of them to see that you’ve fully copied all of the
files properly. Once complete, go back to the original Spotify folder location (in our first Windows Explorer window at AppData\Local), select the Data folder that we just copied, and
hit the Delete key to delete it.
Next, we’re going to create a directory
junction so that your new Data
folder points to where the old one once was. To do so, press the Windows + R keys to again bring up the
Run prompt. Type in “cmd”, but be
sure to press Ctrl + Shift + Enter
(instead of just Enter)—this runs
the prompt as Administrator.
This is where we’ll begin to create our
directory junction. You want to type in the following command: mklink /j <link> <target>,
where <link> is the path to
the original folder (that we’re recreating) and <target> is the path to the new folder (that we’ve pasted).
In my example above, I’d run this command: mklink /j
C:\Users\craig\AppData\Local\Spotify D:\craig\Spotify
It’s important to enclose the folder paths in
quotation marks if they contain a space.
You’ll see a success message after the
directory junction has been created. You should also see that the Data folder now appears again at our
original location, this time with the small “shortcut” icon at the bottom-left
corner.
That’s it! Now, when you play music in
Spotify, it will still cache that data in the original folder at your link
location. However, the directory junction will automatically move it to the new
location and “mirror” it at the original location.
For those of you who use Spotify on a daily
basis, years of regular use can cause this folder to swell to a massive size.
With this simple directory junction trick, you can store all of that data in
any folder on any drive.
Best of all is that this same procedure can be useful in many other useful scenarios—check out how we use a symbolic link to sync folders to Dropbox and OneDrive!