In this paper, we propose a dorsal hand vein recognition system using Convolutional Neural Network (CNN). This system is automatically learned how to extract features from original image without preprocessing. The proposed system has two approaches: the first one is using the pre-trained CNN models (AlexNet, VGG16 and VGG19) for extracting features from 'fc6','fc7' and 'fc8' layers then using Error-Correcting Output Codes (ECOC) with Support Vector machine (SVM) and K-Nearest Neighbor (K-NN) algorithms for the classification. The second approach is using transfer learning with CNN (AlexNet, VGG16 and VGG19) models for both features' extraction and classification. The experiments applied on two different datasets: Dr. Badawi hand veins dataset that contains 500 image and BOSPPHORUS dorsal vein dataset that contains 1575 images. In the first approach experiment, the recognition accuracy of all models gives best result when features are extracted from 'fc6'. Also, the accuracy rate of the models that use ECOC with SVM for classification is higher than the models that use ECOC with KNN and the VGG19 model achieves better results in models that use ECOC with SVM. In the second approach experiment, the recognition accuracy for all models give best result when epoch number is 50 where Dr. Badawi dataset in VGG16 and AlexNet reaches to 100% recognition rate and BOSPPHORUS dataset reaches to 99.25 % recognition rate in VGG19. Finally, the discussion concluded that using transfer learning is giving more accuracy rate than using the pre-trained CNN models for extracting features.