avrdude: ser_open(): can't open device "\\.\COM5": Access is denied

I am trying to upload my code to pro mini by ftdi. But it gives this error.I have installed the drivers for ftdi from here VCP Drivers - FTDI and also tried changing the COM port but it gives the same error with an COM port.Please Help!

Which version of the Arduino IDE are you using?

Arduino 1.6.8

I think you may be encountering a known issue with Arduino IDE 1.6.8, Windows and FTDI: https://github.com/arduino/Arduino/issues/4700 which has already been fixed. You can avoid it by using any IDE version previous to 1.6.8 or if you're feeling adventurous try the hourly build: http://www.arduino.cc/en/Main/Software#hourly