3个复制被锁定或使用中文件的工具

网友投稿 2033 2022-09-16

3个复制被锁定或使用中文件的工具

3个复制被锁定或使用中文件的工具

在操作或维护Windows的过程中,你可能会发现某些文件或文件夹根本无法打开或复制。比如无法打开的硬盘根目录的“​​System Volume Information​​ ”文件夹,或者无法打开System32\Config文件夹中的系统注册表文件。当你打开System32\Config\SAM文件时,会看到这样的提示:另一个程序正在使用此文件,进程无法访问:

打开其它的文件也许会看到这样的提示:操作无法完成,因为文件已经在System中打开:

无法访问这些项目的原因是,要么被故意锁定以防止被访问,要么被操作系统打开正在使用,这些文件被“封锁”起来,任何人都无法触及到它们。

有好几种方法解锁这些文件,比如运行​​Unlocker​​这样的解锁工具,但在解锁重要的系统文件时往往不起作用。本文介绍3个工具,它们或者使用卷影服务(VSS)拍摄快照,或者NTFS底层操作来获得文件的访问权限,这可以绕过Windows的某些限制,从而可以让你手动复制或备份这些被操作系统保护起来的文件。

译者注:经测试,这些软件都可以运行于WIN7,但WIN10不可用。

​​本文所有软件-。​​

1.RawCopy

RawCopy是命令行程序,通过底层的磁盘操作从NTFS格式的磁盘复制文件,无论它是否被锁定。使用方法很简单,只需提供一个单个文件的源路径和名字,以及目标文件夹参数,如果涉及到空格请确保包括引号。

例子:从正在运行的系统中复制休眠文件并将其保存到 E:\output\hiberfil_c.sys:

RawCopy.exe /FileNamePath:C:\hiberfil.sys /OutputPath:E:\output /OutputName:hiberfil_c.sys

默认情况下,该工具使用文件名进行复制。如果因为父文件夹被锁而无法进行复制,RawCopy将使用主文件表中的文件索引号进行复制。rawcopy有32位和64位版本,请确保使用合适的版本。

示例:

从正在运行的系统中复制 SYSTEM 配置单元:

RawCopy.exe /FileNamePath:C:\WINDOWS\system32\config\SYSTEM /OutputPath:E:\output

根据指定的 $MFT 索引号将其提取到程序所在目录,并覆盖输出为 MFT_C.bin:

RawCopy.exe /FileNamePath:C:0 /OutputName:MFT_C.bin

提取 MFT 参考号 30224 和包括 $DATA 在内的所有属性并将其转储到 C:\tmp:

RawCopy.exe /FileNamePath:C:30224 /OutputPath:C:\tmp /AllAttr:1

访问磁盘映像并从卷号 2 中提取 MftRef ($LogFile):

RawCopy.exe /ImageFile:e:\temp\diskimage.dd /ImageVolume:2 /FileNamePath:c:2 /OutputPath:e:\out

访问分区/卷映像并提取 file.ext 并将其转储到 E:\out:

RawCopy.exe /ImageFile:e:\temp\partimage.dd /ImageVolume:1 /FileNamePath:c:\file.ext /OutputPath:e:\out

在 c:\$Extend 中以详细模式制作原始目录列表:

RawCopy.exe /FileNamePath:c:\$Extend /RawDirMode:1

在磁盘映像文件内的 c:\System Volume Information 以基本模式制作原始目录:

RawCopy.exe /ImageFile:e:\temp\diskimage.dd /ImageVolume:1 /FileNamePath:"c:\System Volume Information" /RawDirMode:2

在卷影副本内的根级别以详细模式制作原始目录列表:

RawCopy.exe /FileNamePath:\\.\HarddiskVolumeShadowCopy1x\ /RawDirMode:1

从硬盘 1 上的分区 2 中提取 $MFT 并将其转储到 e:\out:

RawCopy.exe /FileNamePath:\\.\Harddisk0Partition2:0 /OutputPath:e:\out

从 PhysicalDrive0 上的第二个卷中提取 $MFT,并将其保存为 E:\out\MFT_Pd0Vol2.bin:

RawCopy.exe /FileNamePath:\\.\PhysicalDrive0:0 /ImageVolume:2 /OutputPath:e:\out /OutputName:MFT_Pd0Vol2.bin

从系统卷中提取 $LogFile 并通过网络发送:

RawCopy.exe /FileNamePath:c:\$LogFile /TcpSend:1 /OutputPath:10.10.10.10:6666

RawCopy.exe /FileNamePath:c:\$LogFile /TcpSend:1 /OutputPath: mypublicdomain.com:6666

使用手册:

IntroductionThis a console application that copy files off NTFS volumes by using low level disk reading method. SyntaxRawCopy /ImageFile:FullPath\ImageFilename /ImageVolume:[1,2...n] /FileNamePath:FullPath\Filename /OutputPath:FullPath /AllAttr:[0|1] /RawDirMode:[0|1|2] /WriteFSInfo:[0|1] /TcpSend:[0|1]Explanation of parameters/ImageFile:The full path and filename of an image file to extract from. If this param is used, then /ImageVolume: must be set. Optional./ImageVolume:The volume number to extract from. If volume is not NTFS nothing will be extracted. Only used with /ImageFile:./FileNamePath:The full path and filename of file to extract. Can also be in the form of Volume:MftRef. Mandatory./OutputPath:The output path to extract file to. Optional. If omitted, then extract path defaults to program directory./OutputName:The output filename. Optional. If omitted, then filename be that of the original filename. Only used to override the original filename./AllAttr:Boolean flag to trigger extraction of all attributes. Optional. Defaults to 0./RawDirMode:An optional directory listing mode. 0 is no print. 1 is detailed print. 2 is basic print. If omitted it defaults to 0. Can be used in conjunction with any of the other parameters, however in order for this it is not possible to define FileNamePath with an MftRef./WriteFSInfo:An optional boolean flag for writing a file with some volume information into VolInfo.txt in the defined output directory./TcpSendAn optional boolean flag for indicating that output should be sent over network. If this flag is set, then /OutputPath: value must be IP:PORT or DOMAIN:PORTThis tool will let you copy files that usually are not accessible because the system has locked them. For instance the registry hives like SYSTEM and SAM. Or files inside the "System Volume Information". Or pagefile.sys. Or any file on the filesystem.It supports input file specified either with full file path, or by its $MFT record number (index number). So how do you get the index number of a given file that is not one of the known system files? Since version 1.0.0.13 the functionality of RawDir was ported into RawCopy. That way, one can do a search into directories such as the "System Volume Information" (RawCopy.exe /FileNamePath:"c:\System Volume Information" /RawDirMode:2).For image files the volume letter in the /FileNamePath: parameter is ignored.When specifying device paths in /FileNamePath it is possible to access attached devices that does not have any volumes mounted. Examples are HarddiskVolume1, Harddisk0Partition2, HarddiskVolumeShadowCopy1, PhysicalDrive1.In order to extract files from a shadow copy within an image file, you will have to mount the image file beforehand so that Windows will present a symbolic link to the shadow copy such as \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy60. It is recommended to mount the image with a tool such as Arsenal Image Mounter (which is free).The /WriteFSInfo: parameter can be useful when scripting since SectorsPerCluster and MFTRecordSize is used with LogFileParser and Mft2Csv.When using /TcpSend:1 to send output to network you must obviously have something listening on the destination for this to work. For instance netcat. For now, the data is sent as is over network unencrypted.This version is incompatible with Windows 2000 / NTFS 3.0. I have prepared a special build from v1.0.0.19 that can be used there; Earlier versions have not been tested.

​​Download RawCopy​​

2. ShadowSpawn

ShadowSpawn是命令行工具,在使用过程中会调用其它的命令行工具。具体过程是ShadowSpawn使用卷影复制功能(VSS) 将指定的文件夹拷贝到临时 RAM 盘,然后在同一个命令行指定另一个拷贝软件(比如FastCopy),以 RAM 盘作为源盘,把数据拷贝到目标盘符,也就是拷贝过程经过了一次接力。命令行如下:

Shadowspawn C:\windows\system32\config y: fastcopy /open_window y:\ /to=c:\backup

分解上述命令:ShadowSpawn 先把 Config 文件夹的数据复制到临时 RAM 驱动器 (y:),然后调用另一个复制工具 FastCopy 将数据从 y: 复制到备份文件夹c:\backup。 复制完成且复制工具关闭之后,ShadowSpawn 将卸载 RAM 驱动器并退出。

一个技巧是,可以利用Windows资源管理器复制大多数的影子文件而不需要第三方的复制工具,命令行是:

ShadowSpawn C:\windows\system32\config y: cmd /k explorer.exe y:

这会在资源管理器中打开影子驱动器 y: 以查看和复制所需的文件,完成后返回 ShadowSpawn 窗口,按 Ctrl+C 释放 RAM 盘并退出。 该软件有独立的 32 位和 64 位版本,并且需要 Visual C++ 运行时。

更详细的用法见另一篇博客:​​ShadowSpawn​​

3. Shadow Copy

Shadow Copy使用卷影服务,于一个简洁界面将锁定的和正在使用的文件从一个位置复制到另一个位置。虽然该软件只有安装版本,但你可以把程序从安装目录拷贝到其它目录,这就得到了便携版本。

下面有几个单选框,可以复制子目录、覆盖现有文件、忽略错误和解析符号连接Junctions,支持命令行。

该软件的​​官网​​出品从RAID和NAS恢复数据的软件,可以看看。

​​Download Shadow Copy​​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Python Re模块(python能做什么)
下一篇:10个查找和删除重复文件的工具
相关文章

 发表评论

暂时没有评论,来抢沙发吧~