Here is the code to get Desktop path on Windows Vista.
import pythoncom
import win32com.client
pythoncom.CoInitialize()
shell = win32com.client.Dispatch("WScript.Shell")
desktop_path = shell.SpecialFolders("Desktop")
Code works fine when I tried on python interpreter but its not working when I execute the same code from Python script, which runs as a windows service. Function returns desktop path as empty string.
Any idea what is wrong here? Is there any other alternative to get Desktop path when python script runs as Windows Service?