I found the way to do it. I disabled the Windows event log service. Then I could move the log files in to another location.
Cannot move logs file in windows server 2012 R2
Environment details:
I recently migrated on premise Windows 2012 R2 server to Azure cloud. Once migrated I enabled Azure update management and backup for the migrated virtual machine. NLA (Network level authentication) is disabled for this machine.
Problem:
I am trying to move logs files (C:\Windows\System32\winevt\Logs) in the virtual machine to another location to mitigate disk capacity. But when I move it gives me this error "the action cannot be completed because the file is open in dhcp client". But I can copy those files in to another location while I cannot move or delete.
2 additional answers
Sort by: Most helpful
-
SUNOJ KUMAR YELURU 14,021 Reputation points MVP
2021-01-19T07:04:20.277+00:00 I released the lock this way:
Start -> Services
Locate Windows Event Log
Right click -> RestartSolution: close Event Viewer
Please don’t forget to
Accept the answer
andup-vote
wherever the information provided helps you, this can be beneficial to other community members. -
Anonymous
2021-01-19T13:50:01.447+00:00 Are you just trying to copy the files? or move the log location? Assuming the latter you'll need to edit the Reg_Expand_Sz string named File to the new location for each of the event logs.
--please don't forget to Accept as answer if the reply is helpful--