During discovery of windows devices, some of the probes would need access to admin share on the device and throws errors if the credentials do not have enough permissions.
Some of the probes like Windows - Application Dependency Mapping would run Powershell scripts and stores the result in a txt file in admin drive.
After reading the file it would try to remove the file. If the credentials used for discovery do not have enough permissions to access admin share we see an error similar to this:
Discovery throws error: Cannot remove item \\<IP_address>\admin$\temp\file_name.txt: The process cannot access the file '\\<IP_Address>\admin$\temp\file_name.txt' because it is being used by another process.
Ensure that the credential used for discover is able to write/read below path:
Refer to Discovery probe permissions as per docs