If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Script for clearing temp files

Started by krishna.mondrathi, 08 Nov 2016 11:51:29 AM

Previous topic - Next topic

krishna.mondrathi

Hi All,

Could you please send me the script to clear cognos Temps files using scripts in windows.

Regards
Krishna M

Dhruv

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.

krishnadwbi

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

Dhruv

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.