Share via

I can't delete a video file that I once cast to a device, even though it is no longer casting.

Paul Bishop 0 Reputation points
2026-02-24T15:37:25.41+00:00

I occasionally cast short videos to watch on my TV 'Cast to Device' then delete them after watching. However one video file seems to be 'locked' by the program which cast the video, and when I try to delete it, I get the error message "Action can't be completed because the file is open in cast to device server".

Even after closing the casting window and turning off the TV, then shutting down my laptop a few times, and restarting it, nothing seems to work. The file simply won't delete, and I keep getting the same message saying it is being used by the 'Cast to Device Server' even though it is not.

I've tried finding it in task manager, using windows command prompt, resource monitor, and am not able to identify which program to close. There also seems to be no successful way to 'force delete' the video file.

Windows for home | Windows 11 | Files, folders, and storage
{count} votes

2 answers

Sort by: Most helpful
  1. Ferdinand Nanalig 27,995 Reputation points Independent Advisor
    2026-02-24T17:15:38.21+00:00

    Hi! Let me help you with this issue.

    What media player do you use?

    Find the file you would like to move or open. Right-click on the file to display the context menu. From the list of available options, select Open with (or go to Properties if needed), then choose a different default application.

    Set the media player to Movies & TV, Photos, or Media Player (Legacy) depending on the type of file you are working with. Once selected, confirm the change to ensure the file opens using the chosen program going forward.

    Once all is done, try deleting the file.

    0 comments No comments

  2. Q&A Assist
    2026-02-24T15:37:37.7733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It sounds like the video file is still being held open by the Cast to Device server, which can happen even after you've closed the casting application. Here are some steps you can take to resolve this issue:

    1. Check for Orphaned Processes: Sometimes, the application that was casting the video might not have released the file properly. You can use the Task Manager to look for any processes related to media playback or casting and end them. Look for any instances of applications like Windows Media Player, VLC, or any other media applications that might be running.
    2. Use Resource Monitor: Since you've already tried Resource Monitor, ensure that you check the 'CPU' tab and look for handles associated with the video file. This can help identify which process is still using the file.
    3. Restart the Cast to Device Service: You can try restarting the "Cast to Device" service. To do this:
      • Press Windows + R, type services.msc, and hit Enter.
      • Look for the "UPnP Device Host" service, right-click it, and select Restart.
    4. Run Command Prompt as Administrator: You can try using the command prompt to force delete the file. Open Command Prompt as an administrator and use the command:
         del /f /q "C:\path\to\your\file.mp4"
      
      Replace the path with the actual path to your video file.
    5. Check for File System Errors: If the file system has issues, it might prevent file deletion. Run the Chkdsk utility to check for and fix any file system errors. Open Command Prompt as an administrator and type:
         chkdsk C: /f
      
      Replace C: with the appropriate drive letter if necessary.

    If these steps do not resolve the issue, you may need to consider booting into Safe Mode and attempting to delete the file from there, as this can prevent other processes from interfering.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.