- Файл заблокирован процессом Windows, как снять блокировку?
- Как разблокировать файл с помощью Process Explorer?
- Сброс дескриптора файла с помощью утилиты Handle
- Could not open the document because the file is locked. Use the ‘Properties’ command in the Windows Explorer to unlock the file.
- Adobe Support Community
- Adobe Support Community
- Adobe Support Community
Файл заблокирован процессом Windows, как снять блокировку?
Иногда при попытке удалить, переименовать или переместить какой-то файл в Windows вы можете получить сообщение, что файл занят/заблокирован/используется) другим процессом. Чаще всего имя программы, которая держит файл открытым указывается прямо в окне сообщения File Explorer. Чтобы снять блокировку файла достаточно просто закрыть эту программу. Но бывает ситуации, когда какой-то файл и библиотека используется неизвестным или системным процессом. В этом случае снять блокировку с файла немного сложнее.
Сообщение о блокировке файла может выглядеть по-разному. Например в следующем примере указан тип файла и с каким приложением он ассоциирован:
В этом случае вы можете легко понять какое приложение заблокировало файл и закрыть его.
Однако иногда можно увидеть более интересное сообщение, о том, что файл заблокирован неизвестным или системным процессом Windows. Это может быть, как процесс самой ОС Windows, так и другие процессе, работающий с правами System, например, антивирус, агент резервного копирования, база данных mssql и т.д.):
Попробуем разобраться, как понять какой программой, службой или системным процессом Windows занят файл, как разблокировать файл и можно ли разблокировать файл не закрывая родительский процесс.
Самый простой вариант разблокировать файл – завершить процесс, которые его заблокировал. Но это не всегда возможно, особенно на серверах.
Кроме того, это сторонняя утилита, при установке которой нужно быть внимательным, т.к. в процессе она предлагает установить пачку ненужные программы в нагрузку.
Когда процесс в Windows открывает файл, этому потоку ввода/вывода назначается файловый дескриптор (handler). Процесс и его дочерние процессы получают доступ к файлу по этому дескриптору. Через Window API вы можете послать сигнал файловой системе на освобождение данного дескриптора и снятие блокировки с файла.
Как разблокировать файл с помощью Process Explorer?
ProcessExplorer это бесплатная утилита из набора системных утилит Sysinternals, которую можно скачать на сайте Microsoft (https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer). Попробуем с помощью Process Explorer найти, какой процесс заблокировал определенный файл и освободить этот файл, сбросив файловый дескриптор процесса.
- ProcessExplorer не требует установки, просто скачайте распакуйте и запустите с правами администратора procexp.exe ;
- Выберите меню Find ->Find Handle or DLL (или нажмите Ctrl-F );
- Укажите имя файла, который нужно разблокировать и нажмите Search;
- Выберите нужный файл. Процесс, который открыл файлы будет выделен в дереве процессов. Можно завершить этот процесс, щелкнув по нему правой кнопкой и выбрав Kill Process Tree. Но можно попробовать закрыть дескриптор файла, не завершая процесс целиком. Дескриптор файла, который вы искали, автоматически выделяется в нижней панели Process Explorer. Щелкните по дескриптору правой кнопкой и выберите Close handle. Подтвердите закрытие файла.
Итак, вы закрыли дескриптор файла, не завершая родительский процесс. Теперь вы можете спокойно удалить или переименовать файл.
Сброс дескриптора файла с помощью утилиты Handle
Handle – это еще одна утилита командной строки из комплекта инструментов Sysinternals (доступна для скачивания на сайте Microsoft (https://docs.microsoft.com/en-us/sysinternals/downloads/handle. Она позволяет найти процесс, который заблокировал ваш файл и снять блокировку, освободив дескриптор.
- Скачайте и распакуйте архив с утилитой Handle;
- Запустите командную строку с правами администратора и выполните команду: handle64.exe > listproc.txt
Данная команда сохранит список открытых дескрипторов в файл. Можно вывести дескрипторы для каталога, в котором находится файл, который вы хотите изменить: Handle64.exe -a C:\Some\Path или конкретного процесса: handle64.exe -p winword.exe
- Откройте файл listproc.txt в любом текстовом редакторе и найдите строку, в которой указано имя заблокированного файла. Скопируйте ID дескриптора файла (значение в hex формате). Затем поднимитесь немного выше к разделу, в котором указан процесс, являющийся владельцем данного дескриптора и запишите его ID. Для процесса запущенного от имени системы скорее всего будет PID 4.
Если система отреагирует на закрытие файла корректно, вы разблокируете ваш файл без необходимости завершать процесс или перезагружать сервер/компьютер.
Could not open the document because the file is locked. Use the ‘Properties’ command in the Windows Explorer to unlock the file.
I am a member of the administrators group on my computer. I have a folder full of files and other folders that I have denied access to non-administrator users. Not sure when it occurred as I was gone for the holidays, but now I am unable to open any files located within this folder. I can delete, move and rename at will, but cannot open. I have attempted all permissions resets I can think of as well as read through all the knowledge base articles I can find but still cannot get these files to open.
I recently updated MS Security Essentials, not sure if this has any correlation.
At one point I viewed the certificate and it listed it as not trusted. How would this change? Would this impact my ability to open the files yet still let me move, delete and rename them? If so, how can I resolve?
I did restore to a previous restore point and still not open — also rcvd an error telling me MS Security Essentials would not work properly. So I undid the restore.
Thank you in advance for any input. PatrixUSA
Actually, this is beginning to make a lot of sense now. The files you are having problems with have been encrypted with EFS. EFS is closely tied to the NTFS file system. As long as you move encrypted files around in the same Volume, this is not a problem because a move is a directory operation and directories themselves are not encrypted (only the files within them are). Any time you move an encrypted file from one volume to another, the file must be decrypted, transferred to the other volume, then re-encrypted at the destination. Thus, the destination volume must also be a NTFS file system to keep the files encrypted. If the destination is not a NTFS volume, then the copy would result in an unencrypted file existing at the destination and you should be prompted as to whether to allow the operation or not. In any case, a volume-to-volume copy requires decryption of the file and any operation that requires decryption is generating an access error to you — that plus your inability to normally open a file indicates that you no longer control the certificate to decrypt the file.
Backups are another matter. If you use Microsoft’s Backup utility (NTbackup), then it recognizes the encrypted file attribute and backs it up as-is without decrypting it. Other 3rd party backup programs may not recognize encrypted files and simply read them and write them to the backup medium. When this happens, the files are automatically decrypted upon reading (assuming archiving user has needed certificates) and written to backup as an unencrypted file. This would explain why you can retrieve an archive and it doesn’t appear encrypted. DVD and optical tape do not use NTFS so a decryption of original file is required to back up to these media.
The private part of your EFS encryption certificate (needed to decrypt files) is stored itself encrypted on your computer. To decrypt it, Windows uses your SecureID, your password, and other things of which I’m unaware. If your password is not reset the normal way (ie by entering your current password and your new password) such as by an administrator, then your certificate is not re-encrypted to your new password and your lose access to it and with it, access to your EFS files. Other forms of corruption can cause you to lose your certificate but it appears as though at some point you have lost access to your certificate and thus cannot access files that were encrypted under that certificate.
New files that you write to a directory that has been enabled with EFS will notice that you don’t have a valid certificate and then automatically generate a new certificate that will be used to encrypt files from that point forward. That is why new files that you add to this directory seem to work well. The only real mystery that I can’t explain is why a system restore to a time when this wasn’t a problem didn’t allow you to regain access.
If you want some heavy reading, try this:
«Encrypting file System in Windows XP and Windows Server 2003»
Personally, I’m not a fan of EFS because of issues just like this. I prefer the freewareTruecrypt which is just as secure but I myself manage the keys (in form of passphrase) instead of Windows. It also hides filenames and can be used securely over a networked connection and backups from the Windows volume are encrypted no matter how they’re done. I haven’t lost any encrypted data in over ten years.
Adobe Support Community
- Home
- >
- Photoshop
- >
- Re> How do I use «properties command» in Windows E.
Copy link to clipboard
I have cropped graphics files in Photoshop 7 and when I try to save I get message «Adobe Photoshop could not save (files) because the file is locked. Use the «properties» command in Windows Explorer to unlocke the file.
Copy link to clipboard
Right-click on the file in Windows Explorer and choose Properties> Attributes .
If that doesn’t do it, some application may be locking the file you may have to restart to free it.
Copy link to clipboard
There can be several reasons for a file being «locked.» John mentions the major «unlocking,» Attributes. However, there are other factors that can play into things. One is another app. having the file open. One is when the file is on a networked drive, and adequate privileges exist. Another is Windows Indexing, which will lock files, while it tries to gather data on it. Unfortunately with image and AV files, it really cannot get the info that it wants, but that does not stop if from trying and trying, keeping the file locked, while it works on it. The larger the file, the longer it stays locked.
There is at least one file «unlocking» utility, Unlocker, that can address many of the causes.
Please tell us more about the file(s), their location, and whether you have it on a networked drive, or have Windows Indexing turned on.
Adobe Support Community
- Home
- >
- Photoshop
- >
- Re> How do I use «properties command» in Windows E.
Copy link to clipboard
I have cropped graphics files in Photoshop 7 and when I try to save I get message «Adobe Photoshop could not save (files) because the file is locked. Use the «properties» command in Windows Explorer to unlocke the file.
Copy link to clipboard
Right-click on the file in Windows Explorer and choose Properties> Attributes .
If that doesn’t do it, some application may be locking the file you may have to restart to free it.
Copy link to clipboard
There can be several reasons for a file being «locked.» John mentions the major «unlocking,» Attributes. However, there are other factors that can play into things. One is another app. having the file open. One is when the file is on a networked drive, and adequate privileges exist. Another is Windows Indexing, which will lock files, while it tries to gather data on it. Unfortunately with image and AV files, it really cannot get the info that it wants, but that does not stop if from trying and trying, keeping the file locked, while it works on it. The larger the file, the longer it stays locked.
There is at least one file «unlocking» utility, Unlocker, that can address many of the causes.
Please tell us more about the file(s), their location, and whether you have it on a networked drive, or have Windows Indexing turned on.
Adobe Support Community
- Home
- >
- Photoshop
- >
- How do I use «properties command» in Windows Explo.
Copy link to clipboard
I have cropped graphics files in Photoshop 7 and when I try to save I get message «Adobe Photoshop could not save (files) because the file is locked. Use the «properties» command in Windows Explorer to unlocke the file.
Copy link to clipboard
Right-click on the file in Windows Explorer and choose Properties> Attributes .
If that doesn’t do it, some application may be locking the file you may have to restart to free it.
Copy link to clipboard
There can be several reasons for a file being «locked.» John mentions the major «unlocking,» Attributes. However, there are other factors that can play into things. One is another app. having the file open. One is when the file is on a networked drive, and adequate privileges exist. Another is Windows Indexing, which will lock files, while it tries to gather data on it. Unfortunately with image and AV files, it really cannot get the info that it wants, but that does not stop if from trying and trying, keeping the file locked, while it works on it. The larger the file, the longer it stays locked.
There is at least one file «unlocking» utility, Unlocker, that can address many of the causes.
Please tell us more about the file(s), their location, and whether you have it on a networked drive, or have Windows Indexing turned on.