Chronic Obstructive Pulmonary Disease (COPD) is a leading cause of death worldwide, yet early detection and treatment can prevent the progression of the disease. In contrast to the conventional method of detecting COPD with spirometry tests, X-ray Computed Tomography (CT) scans of the chest provide a measure of morphological changes in the lung. It has been shown that automated detection of COPD can be performed with deep learning models. However, the potential of incorporating optimal window setting selection, typically carried out by clinicians during examination of CT scans for COPD, is generally overlooked in deep learning approaches. We aim to optimize the binary classification of COPD with densely connected convolutional neural networks (DenseNets) through implementation of manual and automated Window-Setting Optimization (WSO) steps. Our dataset consisted of 78 CT scans from the Klinikum rechts der Isar research hospital. Repeated inference on the test set showed that without WSO, the plain DenseNet resulted in a mean slice-level AUC of 0.80$\pm$0.05. With input images manually adjusted to the emphysema window setting, the plain DenseNet model predicted COPD with a mean AUC of 0.86$\pm$0.04. By automating the WSO through addition of a customized layer to the DenseNet, an optimal window setting in the proximity of the emphysema window setting was learned and a mean AUC of 0.82$\pm$0.04 was achieved. Detection of COPD with DenseNet models was optimized by WSO of CT data to the emphysema window setting range, demonstrating the importance of implementing optimal window setting selection in the deep learning pipeline.