Usually the folder with name of skype ID
contains the main.db
file!
So we can use this fact to get the skype ID.
One method to do so is to first check if there is any skype folder at that particular path. Then find the folder in the skype folder, that contains the main.db file. If a folder is found then the name of this folder is the skype ID.
I have created a small quick and dirty script for this work. (It can be further improved)
Code:
import getpass
import os
import sys
userName = getpass.getuser() #Get the username
path = "C:\\Users\\"+userName+"\\AppData\\Roaming\\Skype\\"
if (os.path.isdir(path)) == True: #Check if Skype folder exists
subdirectories = os.listdir(path)
for i in subdirectories:
if os.path.isdir(path+i) == True:
if os.path.exists(path+i+"\\main.db"):
print ("Skype Id is %s") %i
else:
print 'Skype folder does not exists'
I hope it was helpful.