FileRepository是什么文件夹?太大能删除吗? (原创)

  • 2021-04-26 22:32
  • by 刘管家
  • 2038
  • 0
  • 0
  • FileRepository

  

  FileRepository(直译成文件仓库)文件夹,是从Windows Vista开始才有的一个系统文件夹,一般位于C:\Windows\System32\DriverStore目录下,正常情况下几百兆大小,一般用来保存系统更新推送的显卡(A卡或N卡,视显卡而定)、打印机、摄像头、调制解调器等设备的驱动程序及备份。Win7、Win8及Win10系统下,此文件夹会随着安装微软推送显卡等的驱动更新不断增大。

  删是可以删,但整个删掉,可能导致以后系统装驱动都要联网找驱动不方便,建议做一下系统还原点或是备份。

  或者可以精细化删除无用的文件:

  • ati*.inf (14.6M) nv*.inf(94.9M) (A卡用户删N、N卡用户删A,- -|||)

  • mdm*.inf (21.6M) 现在早已没人用的东西,删

  • prn*.inf (781M) prn 开头的全部都是打印机驱动,相信大多数人都是用不上的。就是有打印机,买的时候也会带有驱动,删除它!

  • 注意:prnms001.inf/prnoc001.inf/prnms002.inf 这三个并不是打印机驱动,建议保留!

  另外,在删除的时候可能会提示权限不足,可以通过winPE找到C:\Windows\System32\DriverStore\FileRepository这个目录再进行删除。


  以下引用了一篇相关介绍,很详细,可惜是英文的,有耐心的可以翻译了慢慢研究一下。

==========

How to Clean FileRepository Folder in DriverStore?


While cleaning up disk on Windows 10, you can notice that folder FileRepository started taking up too much space (and often it’s a GBs of free space!) and won’t be emptied by using standard cleaning tools.

In this instruction, we will take a closer look at what FileRepository folder is, what does it contains and can we safely delete this data to free up some space.

FileRepository Content in Windows 10

Folder FileRepository contents copies of device driver packages that are ready to be installed. The Staged Drivers located in DriverStore and can be installed without Administrative privileges.

The full path to the folder:

C:\Windows\System32\DriverStore

Here’s how the contents of the FileRepository folder might look like:

clean filerepository folder in driverstore

As you can see, the folder contains many subdirectories, in the name of each the name of the driver’ inf file is specified.

While updating drivers by OS or manually, the old drivers can be stored at this folder, they might be used to roll back the driver later. That’s pretty useful, but these files also occupying a lot of free space.

Cleaning Up DriverStoreFileRepository

Basically you can delete all of the folder contents in Windows 10—but this might be insecure, and you might face with errors, crashes, etc.

The most common situation is when tens or thousands of GBs of disk space is occupied by folder DriveStore—it contains a lot of driver update files for NVIDIA and AMD graphics cards, Realtek sound cards, and, sometimes, regularly driver update files of the plugged-in devices (printers, scanners, etc.). You can drastically reduce the size of the folder FileRepository by deleting files with old drivers (even if you only remove the old video card drivers).

Important. As a precaution, we strongly recommend creating a restore point first before deleting any of the files.

Windows 10 has a built-in disk cleanup tool that can also remove old unused drivers.

  1. Run the Disk Cleanup Wizard by pressing the Win + R keys and entering the command cleanmgr.exe;
    clean filerepository folder disk cleanup

  2. In the Disk Cleanup for (C:) window, click the Cleanup System Files button;

  3. Select the Device driver packages option and click OK to start up the drivers clean up.

However, this method of cleaning the FileRepository folder is extremely inefficient. It is unlikely that you will be able to reduce the size of the folder by more than 30-100 MB.

In case you want to clean up DriverStore folder more deeply, follow the steps below:

  1. Press Win and type in Command Prompt. Right click on it and run it as Administrator.

  2. Type in and the command pnputil.exe /e > c:drivers.txt by clicking Enter.

  3. The command from step 2 will create a file drivers.txt on C: drive with the lists of driver packages that are stored in folder FileRepository.

  4. Now you can delete all unnecessary drivers with the help of command pnputil.exe /d oemNN.inf(NN — is a number of drivers file package from drivers.txt, as for example oem07.inf). In case the driver is in use, you will see an error while trying to delete it.

READ ALSO:  Process PresentationFontCache on Windows 10 and Why It Loads CPU High?


If the driver is not used in the system, the message “Driver package deleted successfully” should appear. Otherwise, an error will appear: “Deleting the driver package failed: One or more devices are presently installed using the specified INF“. If you are sure that you don’t need this driver, you can remove it by using the /f option:

Pnputil.exe /d /f oem2.inf

If there are a lot of drivers in the system, you can use the following script for automatic driver removal. Create a text file cleanupdrivers.bat with the following code and run it as an administrator. This script will sequentially loop all inf files with an index from 1 to 400 and delete the corresponding driver files. If the driver is used or doesn’t exist, it will be skipped:

@echo off
for /L %%N in (1,1,400) do (
  echo Deleting driver OEM%%N.INF
  pnputil /d OEM%%N.INF
)

For your convenience, you can create an Excel table with lists of all installed drivers, find duplicates of the same driver and sort them by installation date and/or driver’s version. It is advisable to keep the system with only the most recent version of each driver.

  1. You can export the list of drivers to a text file using the command:

    dism /online /get-drivers /format:table > c:\drivers.txt
  2. Then the text file must be cleared of the text lines;

  3. Import this file to the Excel app, delete empty rows and columns;

  4. As a result, you will get a list of driver names, versions, class names, vendors and installation dates;

  5. It remains to sort the list and select the driver with the same name (except for the latest version by the installation date);

  6. Now you can remove the old drivers using the pnputil utility as described above.

We recommend you delete old graphic card’s drivers at first (in Windows 10 you can find info about the current version of drivers in Device manager).

READ ALSO:  Fixing Application Error 0xc0000142 on Windows 10 Machine



You can delete older files; that won’t hurt your computer. Also, you are free to delete old drivers for other connected devices (printers, scans, etc.). It is not recommended to delete unknown system device’s drivers (like Intel, AMD, and others). After removing the drivers, restart your computer. If after the system boot some devices will have the description Unknown device with a yellow icon in the Device Manager, such drivers needed to be downloaded and installed manually or using the automatic driver update feature.

After the finish check the DriverStore folder – what size does it have now? Most likely, it’s drastically reduced.

Using Driver Store Explorer

The task described above can be also performed with the help of Driver Store Explorer (RAPR) utility, here is a link to download.

Run the program with Administrative privileges and press Enumerate.


After that, you need to choose packages to delete. Check on them and press Delete Package (drivers that are used by the system at the moment won’t be deleted in case you didn’t check on Force Deletion option.

Tip. You can choose old drivers automatically by pressing Select Old Drivers button.

How to Clean FileRepository Folder Manually?

Important! Implementing of these instructions can cause crashes in Windows 10 and can damage your system! Do it only on your own risk!

You can delete files in FileRepository manually (but it’s insecure and not recommended):

  1. Go to folder C:\Windows\System32\DriverStore, right click on FileRepository folder and press Properties.

  2. Go to Security tab and click on Advanced.

  3. Near Owner field click on Change.

  4. Type in your user name or click Advanced > Find Now and choose it from the list. Click ОK.

  5. Check on Replace owner on subcontainers and Replace all child object permission entries with inheritable permission entries from this object. Press OK and confirm the operation.

  6. Now you will get back to tab Security. Click on Edit under the users list.

  7. Press Add… > Advanced, find your account in the list and choose it. Set Full controlpermissions to it. Click ОK and confirm the changes. After finish, click OK.

  8. Now the contents of the folder can be deleted manually (some of the files still cannot be deleted because they used by OS at the moment, you can skip them by clicking on the appropriate button).

That’s all! Hope this was useful and helped you to free up some space by cleaning up FileRepository folder.



评论