Create Log file for Application

1. Create Log Folder in the project folder
2. Create Batch file and Add following

@echo ---------------------------------------------------------
@rem ************* Project nameBatch Commands *************
@echo --------------------------------------------------------------
@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(
Set Month=%%A
Set Day=%%B
Set Year=%%C
)
@set ProjDir=C:\Projects\project@set logfile=%ProjDir%\Log\log%Month%%DAY%%Year%.txt@echo %logfile%@set app_exe=%ProjDir%\ProjFolder\bin\Debug\Project.exe%app_exe% >> %logfile%
cls

Comments

Popular posts from this blog

IBM FileNet: Bulk Processing using JavaScript

DB2 Date Time Functions

File Net Insert Document