How to create a hard link in C:\Windows if the file is located in D:\Documents\CommandLineScanner\cmdscanner.log I want to locate the log file at D:\Documents\CommandLineScanner\cmdscanner.log then create a hard link in C:\Windows My goal is to keep the driver from writing at this log file in C:\ which is a SSD. I want to prolong its life as long as I can. The log file grows rapidly as it logs every process and its cmd line found in the system.
You cannot create a hard link between different disks/volumes, but you can make a soft (symbolink) link. Code: mklink C:\Windows\cmdscanner.log D:\Documents\CommandLineScanner\cmdscanner.log
Could you tell me how to do that please? Not much time these days lately... See, the symlink does not survives a machine restart and when managing the mini driver from its tray application. It just simply vanishes and the real log file is re-created. Maybe the mini driver is quite sensitive to such tweaks.
The system policy is in the Group Policy Editor under Administrative Templates - System - Filesystem - Selectively allow the evaluation of a symbolic link. Local admin uses the commandline: Code: fsutil.exe behavior query/set symlinkevaluation But in the end, it depends on how exactly the log is accessed: If the log is simply opened and written into, the symlink should stay in place. However, some applications might delete or rename the log file, then create a brand new one. In this case, symlinking the directory the log is in might help.