Batch or CMD file naming for log files


::Log Filename & Folder
::::::::::::::::::::::::::::::::::::::::::::::::::::Set FP to current Directory Path of executable '0' and file Name and append _LOGS
set fp=%~dp0%~n0_Logs\                           
::::::::::::::::::::::::::::::::::::::::::::::::::::Make the file path - will complain and skip if exists
@mkdir %fp%
::::::::::::::::::::::::::::::::::::::::::::::::::::Set variable to be the log file name and use that
SET LOG_FNAME=%fp%%USERNAME%@%COMPUTERNAME%.log  


Comments

Popular posts from this blog

Powerpoint countdown and current time in slides VBA

Revit area plans adding new types and references (Gross and rentable)

PS1 search for existing edge/opened link before opening