Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

Robocopy to copy locked files by a previous administrator

I am trying to copy over data from a server, however one of the folders was locked by a previous Admin and he is now no longer on the network.
We can see the files but not delete them, and they are no longer necessary.
Is there a way to completely change over the permissions to the network administrator?
Is there a way to copy over those files without the permissions into another directory using Robocopy?

This is in a Windows Server 2012 environment.. 
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

Is there a way to completely change over the permissions to the network administrator?
go to the folder properties and change the folder permissions there; may need to take ownership first if you get an error

Is there a way to copy over those files without the permissions into another directory using Robocopy?
you would need to have read permissions on the files and folders first
something like...

robocopy d:\source e:\destination /r:1 /w:1 /v /s /e /copy:dat

Open in new window


...if you just want the files

Avatar of Hello There
Hello There

Reset his password, log on under his account and delete the folder.
Avatar of E=mc2

ASKER

His user no longer exists.. it was deleted years ago.. 
Then take ownership over this folder. If you don't know how, here is the guide:
https://www.laptopmag.com/articles/take-ownership-folder-windows-10-using-file-explorer
Get Unlocker... great tool to have in your kit: Download Unlocker 1.9.2 (softpedia.com) 
Take ownership, like everyone else has said.  If you have the command line utility:
 TAKEOWN.exe /F directory /R /D N

If you've opened admin powershell or admin command prompt, you should have access to copy the files without taking ownership
robocopy.exe  /r:0 /w:0 /sl /xj /e /copy:dat c:\Users\username m:\destination

Open in new window


If you would rather try to take ownership than force unlock the file, don't forget to run command from administrative command prompt.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.