Hello friends... Thanks for your comments. I am taking help from the following article provided with Codeproject: http://www.codeproject.com/vb/net/Windows\_Service.asp What i understand from this is, we can have access to the WMI. This WMI shows all the information regarding the various processes running in machine. As i want to get the username in which i am currently logged-in, So, i am using the Win32_Process (which gives the name of process explorer... and the substring of, name of process explorer contains the currently logged-in username(eg.. user_nameprocess.exe) . Using string operations... i am trying to extract that particular username part of the process explorer name. Now,Taking help of this, i have added System.Management reference to my project (VC++.NET/windows XP) and then i got two files namely ROOT.CIMV2.Win32_Process.h/cpp with my project name. And in the ROOT.CIMV2.Win32_Process.cpp contains following lines of code: #include Stdafx.h #include ROOT.CIMV2.Win32_Process.h After this i added System refrence through the project properties. But while building this project, i am getting some errors in these new files ROOT.CIMV2.Win32_Process.h/cpp. and command line options are: C/C++ Command line options: /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\myservice.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W0 /nologo /c /Zi /clr:pure /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" Linker Command Line Options: /OUT:"D:\Apr\2\myservice\Debug\myservice.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\myservice.exe.intermediate.manifest" /DEBUG /ASSEMBLYDEBUG /PDB:"d:\Apr\2\myservice\debug\myservice.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib And stdafx.h file looks like this: #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // TODO: reference additional headers your program requires here #define _AFXDLL /*I included this, bcoz if i don't, then i m getting an build error: D:\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version.