Hi All,
Could you please send me the script to clear cognos Temps files using scripts in windows.
Regards
Krishna M
Use below script:
===
net start SERVICENAME
RD /S /Q <drive>:Cognos_location\temp
mkdir <drive>:cognos_location\temp
timeout /T 2
net start SERVICENAME
===
Script will stop service, Remove contents from temp folder and Start service again.
Let me know if this works for you.
Hi Dhurv,
Thanks for your mail!
Actually the below script will remove directory and recreates the same. But my requirements is delete the logs till day-1.
Could you please provide me the above script.
Regards
Krishna m
Hello Krishna,
Below command will work for you.
forfiles -p "DESTINATION_FOLDER" -s -m *.* -d -1 -c "cmd /c echo @file"
use this command in batch file and it will remove all logs older than day -1.
Let me know if this works for you.