Hi could someone help me out to move these files? I'm trying to execute the following: for /f %x in ('wevtutil el') do wevtutil sl "%x" /lfn:"D:\Logs\%x.evtx" But x in cases sometimes returns with a folder such as "microsoft-windows-wordpad/diagnostic". That means wevtutil sl "microsoft-windows-wordpad/diagnostic" /lfn:"D:\Logs\microsoft-windows-wordpad/diagnostic.evtx" that is bad. Can someone rewrite this so forward slash is replaced with a backslash in the do block and a subdirectory is created when necessary? (win only starts to log if the folder exists as in the path)
basics... set "torename=wevtutil sl "microsoft-windows-wordpad/diagnostic" /lfn:"D:\Logs\microsoft-windows-wordpad/diagnostic.evtx"" set "torename=%torename:/=\%" set "torename=%torename:\lfn=/lfn%" etc. echo %torename%