- Fix: The Action Cannot be Completed Because the File is Open in Windows Explorer
- What is causing the action cannot be completed because the file is open in windows explorer error?
- Method 1: Turning off File previews in Windows Explorer
- Method 2: Identifying & closing the process that has the file open
- Build actions
- Set a build action
- Build action values
- Details of extension .action
- Automator Action
- Can’t open a .action file?
- To change file associations:
- Supported operating systems
- Действия при сборке Build actions
- Задание действия при сборке Set a build action
- Значения действий при сборке Build action values
Fix: The Action Cannot be Completed Because the File is Open in Windows Explorer
Some users are encountering the ‘action cannot be completed because the file is open in windows explorer‘ error when they try to delete, move or rename a file on a Windows computer. The issue typically happens with Microsoft Office files (Word and Excel files) and PDF files. The issue is not specific to a certain Windows version as it’s encountered on Windows 7, Windows 8 and Windows 10.
The action cannot be completed because the file is open in windows explorer
What is causing the action cannot be completed because the file is open in windows explorer error?
We investigated this particular issue by looking at various user reports and the repair strategies that they used to get the issue resolved. Based on what we gathered, there a couple of common scenarios that are known to trigger this particular error message:
- The file preview window of Windows Explorer is causing the error – This is typically reported to occur with PDF and image files. As it turns out, the previewing feature of Windows Explorer can glitch out in certain situations and prevent the user from handling the file. In this case, you can resolve the issue by disabling file previews in Windows Explorer.
- The file is being actively used by another process – This is one of the most common reasons why this error occurs. Most likely, the process behind Windows Explorer (explorer.exe) or a different process is using the file you’re trying to handle. In this case, the issue can be resolved by closing the process responsible for the conflict.
If you’re struggling to resolve the ‘action cannot be completed because the file is open in windows explorer‘ error, this article will provide you with a couple of verified troubleshooting steps. Down below you’ll find two methods that other users in a similar situation have used to get the issue resolved.
If you want to be efficient, we encourage you to follow the methods below in the order that they are presented.
Method 1: Turning off File previews in Windows Explorer
Most of the users encountering the ‘action cannot be completed because the file is open in windows explorer‘ error has managed to get it resolved by disabling file preview on Windows Explorer. As it turns out, this feature is known to sometimes glitch on all the recent Windows versions and prevent the user from handling PDF and various image-type files.
Affected users report that the issue was resolved once they followed a set of instructions to disable thumbnail previews from folder options. Here’s what you need to do:
- Press Windows key + R to open up a Run dialog box. Then, type “control folders” and press Enter to open the File Explorer Options screen.
- Inside the File Explorer window, go to the View tab, go to Advanced settings and make sure that the box associated with Always show icons, never thumbnails is enabled.
- Click Apply to save the changes and see if you’re able to handle the file without seeing the ‘action cannot be completed because the file is open in windows explorer‘.
Disabling thumbnails in Windows Explorer
If you’re still struggling with the error, move down to the next method below.
Method 2: Identifying & closing the process that has the file open
A couple of users struggling to resolve this particular issue have managed to do so by using Resource Monitor to locate the processes that are using the file triggering the error and closing it down. This process is all done from Windows (no additional software is needed).
Here’s a quick guide on identifying and closing the process the is triggering the ‘action cannot be completed because the file is open in windows explorer‘ error:
- Press Windows key + R to open up a Run dialog box. Then, type “resmon.exe” and press Enter to open up the Resource Monitor utility.
Opening the Resource Monitor from a Run box
- Inside the Resource Monitor utility, navigate to the CPU tab, scroll down to Associated Handles. Next, type the name of the file triggering the issue. In our case, the file triggering the issue is named last day.xlsx. So we typed in ‘last day‘ in the search box and discovered that the process using it was Excel.exe.
Discovering the process using the file
Note: This search can be performed with any type of file.
Right-click on the process that is using the file triggering the error and choose End process. Ending the process causing the error
Build actions
All files in a Visual Studio project have a build action. The build action controls what happens to the file when the project is compiled.
This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Build actions in Visual Studio for Mac.
Set a build action
To set the build action for a file, open the file’s properties in the Properties window by selecting the file in Solution Explorer and pressing Alt+Enter. Or, right-click on the file in Solution Explorer and choose Properties. In the Properties window, under the Advanced section, use the drop-down list next to Build Action to set a build action for the file.
Build action values
Some of the more common build actions for C# and Visual Basic project files are:
Build Action | Project types | Description |
---|---|---|
AdditionalFiles | C#, Visual Basic | A non-source text file that’s passed to the C# or Visual Basic compiler as input. This build action is mainly used to provide inputs to analyzers that are referenced by a project to verify code quality. For more information, see Use additional files. |
ApplicationDefinition | WPF | The file that defines your application. When you first create a project, this is App.xaml. |
CodeAnalysisDictionary | .NET | A custom word dictionary, used by Code Analysis for spell checking. See How to: Customize the Code Analysis Dictionary |
Compile | any | The file is passed to the compiler as a source file. |
Content | .NET | A file marked as Content can be retrieved as a stream by calling Application.GetContentStream. For ASP.NET projects, these files are included as part of the site when it’s deployed. |
DesignData | WPF | Used for XAML ViewModel files, to enable user controls to be viewed at design time, with dummy types and sample data. |
DesignDataWithDesignTimeCreateable | WPF | Like DesignData, but with actual types. |
Embedded Resource | .NET | The file is passed to the compiler as a resource to be embedded in the assembly. You can call System.Reflection.Assembly.GetManifestResourceStream to read the file from the assembly. |
EntityDeploy | .NET | For Entity Framework (EF) .edmx files that specify deployment of EF artifacts. |
Fakes | .NET | Used for the Microsoft Fakes testing framework. See Isolate code under test using Microsoft Fakes |
None | any | The file isn’t part of the build in any way. This value can be used for documentation files such as «ReadMe» files, for example. |
Page | WPF | Compile a XAML file to a binary .baml file for faster loading at run time. |
Resource | WPF | Specifies to embed the file in an assembly manifest resource file with the extension .g.resources. |
Shadow | .NET | Used for an .accessor file that contains a list of built assembly filenames, one per line. For each assembly on the list, generate public classes with the names ClassName_Accessor that are just like the originals, but with public methods instead of private methods. Used for unit testing. |
Splash Screen | WPF | Specifies an image file to be displayed at run time when the app is starting up. |
XamlAppDef | Windows Workflow Foundation | Instructs the build to build a workflow XAML file into an assembly with an embedded workflow. |
Additional build actions may be defined by for specific project types, so the list of build actions depends on the project type and values might appear that are not in this list.
Details of extension .action
1 extension(s) and 0 alias(es) in our database
Below, you can find answers to the following questions:
- What is the .action file?
- Which program can create the .action file?
- Where can you find a description of the .action format?
- What can convert .action files to a different format?
- Which MIME-type is associated with the .action extension?
Automator Action
Other types of files may also use the .action file extension. If you have helpful information about .action extension, write to us!
Can’t open a .action file?
If you want to open a .action file on your computer, you just need to have the appropriate program installed. If the .action association isn’t set correctly, you may receive the following error message:
Windows can’t open this file:
To open this file, Windows needs to know what program you want to use to open it. Windows can go online to look it up automatically, or you can manually select from a list of programs that are installed on your computer.
To change file associations:
- Right-click a file with the extension whose association you want to change, and then click Open With.
- In the Open With dialog box, click the program whith which you want the file to open, or click Browse to locate the program that you want.
- Select the Always use the selected program to open this kind of file check box.
Supported operating systems
Windows Server 2003/2008/2012/2016, Windows 7, Windows 8, Windows 10, Linux, FreeBSD, NetBSD, OpenBSD, Mac OS X, iOS, Android
Действия при сборке Build actions
Все файлы в проекте Visual Studio имеют действие при сборке. All files in a Visual Studio project have a build action. Действие при сборке определяет, что происходит с файлом при компиляции проекта. The build action controls what happens to the file when the project is compiled.
Этот раздел относится к Visual Studio в Windows. This topic applies to Visual Studio on Windows. Информацию о Visual Studio для Mac см. в статье Действия при сборке в Visual Studio для Mac. For Visual Studio for Mac, see Build actions in Visual Studio for Mac.
Задание действия при сборке Set a build action
Чтобы задать действие при сборке для файла, откройте свойства в окне Свойства, выбрав файл в обозревателе решений и нажав клавиши ALT+ВВОД. To set the build action for a file, open the file’s properties in the Properties window by selecting the file in Solution Explorer and pressing Alt+Enter. Либо щелкните правой кнопкой мыши файл в обозревателе решений и выберите пункт Свойства. Or, right-click on the file in Solution Explorer and choose Properties. В разделе Дополнительно окна Свойства используйте стрелку раскрывающегося списка рядом с полем Действие при сборке, чтобы задать действие при сборке для файла. In the Properties window, under the Advanced section, use the drop-down list next to Build Action to set a build action for the file.
Значения действий при сборке Build action values
Ниже перечислены наиболее распространенные действия при сборке для файлов проекта C# и Visual Basic. Some of the more common build actions for C# and Visual Basic project files are:
Действие построения Build Action | Типы проектов Project types | Описание Description |
---|---|---|
AdditionalFiles AdditionalFiles | C#, Visual Basic C#, Visual Basic | Текстовый файл, не связанный с исходным кодом и передаваемый компилятору C# или Visual Basic в качестве входных данных. A non-source text file that’s passed to the C# or Visual Basic compiler as input. Это действие при сборке используется в основном для передачи входных данных в анализаторы, на которые ссылается проект, для проверки качества кода. This build action is mainly used to provide inputs to analyzers that are referenced by a project to verify code quality. Дополнительные сведения см. в разделе Использование дополнительных файлов. For more information, see Use additional files. |
ApplicationDefinition ApplicationDefinition | WPF WPF | Файл, в котором определено приложение. The file that defines your application. При создании проекта это файл App.xaml. When you first create a project, this is App.xaml. |
CodeAnalysisDictionary CodeAnalysisDictionary | .NET .NET | Пользовательский словарь, используемый средством анализа кода для проверки орфографии. A custom word dictionary, used by Code Analysis for spell checking. См. практическое руководство по настройке словаря для анализа кода See How to: Customize the Code Analysis Dictionary |
Компилятор Compile | any any | Файл передается компилятору в виде файла исходного кода. The file is passed to the compiler as a source file. |
Содержимое Content | .NET .NET | Файл, помеченный как Content, можно извлечь в виде потока, вызвав Application.GetContentStream. A file marked as Content can be retrieved as a stream by calling Application.GetContentStream. Для проектов ASP.NET эти файлы включаются в состав сайта при его развертывании. For ASP.NET projects, these files are included as part of the site when it’s deployed. |
DesignData DesignData | WPF WPF | Используется для файлов XAML ViewModel, позволяя просматривать пользовательские элементы управления во время разработки с фиктивными типами и демонстрационными данными. Used for XAML ViewModel files, to enable user controls to be viewed at design time, with dummy types and sample data. |
DesignDataWithDesignTimeCreateable DesignDataWithDesignTimeCreateable | WPF WPF | Действие, аналогичное DesignData, но предусматривающее использование фактических типов. Like DesignData, but with actual types. |
Embedded Resource Embedded Resource | .NET .NET | Файл передается компилятору в виде ресурса, внедряемого в сборку. The file is passed to the compiler as a resource to be embedded in the assembly. Вы можете вызвать System.Reflection.Assembly.GetManifestResourceStream для чтения файла из сборки. You can call System.Reflection.Assembly.GetManifestResourceStream to read the file from the assembly. |
EntityDeploy EntityDeploy | .NET .NET | Действие для файлов EDMX Entity Framework (EF), определяющее развертывание артефактов EF. For Entity Framework (EF) .edmx files that specify deployment of EF artifacts. |
Fakes Fakes | .NET .NET | Используется для платформы тестирования Microsoft Fakes. Used for the Microsoft Fakes testing framework. Сведения см. в статье Изоляция тестируемого кода с помощью Microsoft Fakes. See Isolate code under test using Microsoft Fakes |
None None | any any | Файл не является частью сборки. The file isn’t part of the build in any way. Это значение можно использовать для файлов документации, например файлов сведений. This value can be used for documentation files such as «ReadMe» files, for example. |
Страница Page | WPF WPF | Компилирует файл XAML в двоичный файл BAML для ускорения загрузки во время выполнения. Compile a XAML file to a binary .baml file for faster loading at run time. |
Ресурс Resource | WPF WPF | Указывает, что файл будет внедрен в файл ресурсов манифеста сборки с расширением .g.resources. Specifies to embed the file in an assembly manifest resource file with the extension .g.resources. |
Shadow Shadow | .NET .NET | Используется для файла ACCESSOR, содержащего построчный список имен файлов сборки. Used for an .accessor file that contains a list of built assembly filenames, one per line. Для каждой сборки в списке создайте открытые классы с именами ClassName_Accessor , которые аналогичны оригиналам, но имеют открытые, а не закрытые методы. For each assembly on the list, generate public classes with the names ClassName_Accessor that are just like the originals, but with public methods instead of private methods. Используется для модульного тестирования. Used for unit testing. |
Экран-заставка Splash Screen | WPF WPF | Определяет файл изображения, которое будет отображаться во время выполнения при запуске приложения. Specifies an image file to be displayed at run time when the app is starting up. |
XamlAppDef XamlAppDef | Windows Workflow Foundation Windows Workflow Foundation | При сборке создает файл XAML рабочего процесса в сборке с внедренным рабочим процессом. Instructs the build to build a workflow XAML file into an assembly with an embedded workflow. |
Для проектов конкретных типов могут определяться дополнительные действия сборки, поэтому список действий сборки зависит от типа проекта и в нем могут присутствовать значения, отсутствующие в этом списке. Additional build actions may be defined by for specific project types, so the list of build actions depends on the project type and values might appear that are not in this list.