C language function:CreateProcessAsUser sample codes

Search sample code in the internet.It is the result.


TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
WindowsApi.CreateProcessAsUser(UserTokenHandle, "C:\Windows\System32\cmd.exe", IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, False, 0, IntPtr.Zero, Nothing, StartInfo, ProcInfo).......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/


TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
Public Shared Function CreateProcessAsUser( ByVal hToken As IntPtr, _.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
CreateProcessAsUser(UserTokenHandle, Nothing, CommandLine, IntPtr.Zero, IntPtr.Zero, False, ApiDefinitions.CREATE_UNICODE_ENVIRONMENT Or ApiDefinitions.CREATE_NEW_CONSOLE, EnvironmentBlock, Nothing, StartInfo, ProcInfo).......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
Error 1 eWindowsApi.CreateProcessAsUser(System.IntPtr, string, System.IntPtr, System.IntPtr, System.IntPtr, bool, uint, System.IntPtr, string, ref WindowsApi.STARTUPINFOW, ref WindowsApi.PROCESS_INFORMATION)f cannot specify only Out attribute on a ref parameter. Use both In and Out attributes, or neither.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
Private Shared Function CreateProcessAsUser( _.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
If Not CreateProcessAsUser(phNewToken, _.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
CreateProcessAsUser(UserTokenHandle, A.c_str() , NULL, NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &ProcInfo);.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : VB.NET – Start process in console session from windows service on Windows 7 « Cjwdev
CreateProcessAsUser(UserTokenHandle, NULL, A.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &ProcInfo);.......
http://blog.cjwdev.co.uk/2011/06/10/vb-net-start-process-in-console-session-from-windows-service-on-windows-7/
TITLE : CreateProcessAsUser() - C# / C Sharp
home > topics > c# / c sharp > questions > createprocessasuser().......
http://bytes.com/topic/c-sharp/answers/229632-createprocessasuser
TITLE : CreateProcessAsUser() - C# / C Sharp
CreateProcessAsUser().......
http://bytes.com/topic/c-sharp/answers/229632-createprocessasuser
TITLE : CreateProcessAsUser() - C# / C Sharp
CreateProcessAsUser() to do impersonation?.......
http://bytes.com/topic/c-sharp/answers/229632-createprocessasuser
TITLE : CreateProcessAsUser() - C# / C Sharp
* CreateProcessAsUser() - Windows Vista Trouble.......
http://bytes.com/topic/c-sharp/answers/229632-createprocessasuser
TITLE : Run as interactive user from service
bRet = CreateProcessAsUser(userToken, _T("C:\\Windows\\notepad.exe"), NULL, NULL, NULL, FALSE, CREATE_UNICODE_ENVIRONMENT, pEnvironment, NULL, &si, &processInformation);.......
http://chabster.blogspot.com/2008/01/run-as-interactive-user-from-service.html
TITLE : GINATv
bResult = CreateProcessAsUser(lpgc->hToken, szExe, NULL, NULL, NULL, FALSE, CREATE_UNICODE_ENVIRONMENT, pEnvironment, NULL, &si, &pi);.......
http://eternalwindows.jp/security/gina/gina18.html
TITLE : Using a Token to Execute Code - Programming Server-Side Applications for Microsoft Windows 2000 (Microsoft Programming)
BOOL CreateProcessAsUser(.......
http://flylib.com/books/en/4.420.1.88/1/
TITLE : Processes: How can I start a process?
* 'CreateProcessAsUser()' (Win32 API).......
http://forums.codeguru.com/showthread.php@302501-Processes-How-can-I-start-a-process
TITLE : Laurent GaffiH blog
h,tn,pi,ti = win32process.CreateProcessAsUser(UserToken, "c:\\Windows\\system32\\cmd.exe", "/c "+' '.join(sys.argv[1:]), None, None, True, win32con.NORMAL_PRIORITY_CLASS, None, None, win32process.STARTUPINFO()).......
http://g-laurent.blogspot.com/
TITLE : Advapi32 (JNA API)
boolean CreateProcessAsUser(WinNT.HANDLE hToken, String lpApplicationName, String lpCommandLine, WinBase.SECURITY_ATTRIBUTES lpProcessAttributes, WinBase.SECURITY_ATTRIBUTES lpThreadAttributes, boolean bInheritHandles, int dwCreationFlags, String lpEnvironment, String lpCurrentDirectory, WinBase.STARTUPINFO lpStartupInfo, WinBase.PROCESS_INFORMATION lpProcessInformation).......
http://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Advapi32.html
TITLE : Advapi32 (JNA API)
boolean CreateProcessAsUser(WinNT.HANDLE hToken,.......
http://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Advapi32.html
TITLE : Understanding and Working in Protected Mode Internet Explorer - Browser Forensics - Knowledge Base
bRet = CreateProcessAsUser(hNewToken, NULL,.......
http://kb.digital-detective.net/display/BF/Understanding+and+Working+in+Protected+Mode+Internet+Explorer
TITLE : CreateProcessAsUser from service fails with 233 (FUS, Windows XP)
result = CreateProcessAsUser(...);.......
http://microsoft.public.platformsdk.security.narkive.com/iODXoxmo/createprocessasuser-from-service-fails-with-233-fus-windows-xp
TITLE : CreateProcessAsUser function (Windows)
BOOL WINAPI CreateProcessAsUser(.......
http://msdn.microsoft.com/ja-jp/library/windows/desktop/ms682429(v=vs.85).aspx
TITLE : CreateProcessAsUser function (Windows)
CreateProcessAsUser(hToken, NULL, szCmdline, /*...*/ );.......
http://msdn.microsoft.com/ja-jp/library/windows/desktop/ms682429(v=vs.85).aspx
TITLE : CreateProcessAsUser function (Windows)
CreateProcessAsUser(hToken, NULL, szCmdline, /*...*/);.......
http://msdn.microsoft.com/ja-jp/library/windows/desktop/ms682429(v=vs.85).aspx
TITLE : CreateProcessAsUser
private void CreateProcessAsUser().......
http://odetocode.com/blogs/scott/archive/2004/10/29/createprocessasuser.aspx
TITLE : CreateProcessAsUser
result = ProcessUtility.CreateProcessAsUser(.......
http://odetocode.com/blogs/scott/archive/2004/10/29/createprocessasuser.aspx
TITLE : CreateProcessAsUser
CreateProcessAsUser(IntPtr hToken, string lpApplicationName, string lpCommandLine,.......
http://odetocode.com/blogs/scott/archive/2004/10/29/createprocessasuser.aspx
TITLE : CreateProcessAsUser
ret = CreateProcessAsUser(DupedToken,null,commandLinePath, ref sa, ref sa, true, 0, (IntPtr)0, "c:\\", ref si, out pi);.......
http://odetocode.com/blogs/scott/archive/2004/10/29/createprocessasuser.aspx
TITLE : » Running processes on the Winlogon desktop - Spinning mirrors
if (!CreateProcessAsUser(newToken, 0, cmdline, 0, 0, 0, 0, 0, 0, &si, &pi)).......
http://omeg.pl/blog/2014/01/running-processes-on-the-winlogon-desktop/
TITLE : Create a Process as Logged-On-User from PowerShell
private static extern bool CreateProcessAsUser(.......
http://rzander.azurewebsites.net/create-a-process-as-loggedon-user/
TITLE : Create a Process as Logged-On-User from PowerShell
if (!CreateProcessAsUser(hUserToken,.......
http://rzander.azurewebsites.net/create-a-process-as-loggedon-user/
TITLE : windows - example code: A service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0 - Stack Overflow
example code: A service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0.......
http://stackoverflow.com/questions/7285666/example-code-a-service-calls-createprocessasuser-i-want-the-process-to-run-in
TITLE : windows - example code: A service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0 - Stack Overflow
For a service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0.......
http://stackoverflow.com/questions/7285666/example-code-a-service-calls-createprocessasuser-i-want-the-process-to-run-in
TITLE : windows - example code: A service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0 - Stack Overflow
rc = CreateProcessAsUser(hUserToken, // user token.......
http://stackoverflow.com/questions/7285666/example-code-a-service-calls-createprocessasuser-i-want-the-process-to-run-in
TITLE : windows - example code: A service calls CreateProcessAsUser() I want the process to run in the user's session, not session 0 - Stack Overflow
Also, you should call CreateEnvironmentBlock() before calling CreateProcessAsUser() as well. ? Remy Lebeau Mar 5 '14 at 22:51.......
http://stackoverflow.com/questions/7285666/example-code-a-service-calls-createprocessasuser-i-want-the-process-to-run-in
TITLE : CreateProcessAsUser() windowstations and desktops
CreateProcessAsUser() windowstations and desktops.......
http://support.microsoft.com/ja-jp/help/165194/createprocessasuser-windowstations-and-desktops
TITLE : CreateProcessAsUser() windowstations and desktops
if (!CreateProcessAsUser(.......
http://support.microsoft.com/ja-jp/help/165194/createprocessasuser-windowstations-and-desktops
TITLE : Starting the Spawner on Windows
This right needs to be held by the owner of an objspawn process. The Windows routine CreateProcessAsUser() requires this user right for the process owner in order for that user to be able to launch SAS sessions on behalf of the connecting client........
http://support.sas.com/rnd/itech/doc9/admin_oma/sasserver/startserv/sp_suwin.html
TITLE : Kenny Kerr - Windows Vista for Developers Part 4 User Account Control
VERIFY(::CreateProcessAsUser(restrictedToken,.......
http://weblogs.asp.net/kennykerr/Windows-Vista-for-Developers-_1320_-Part-4-_1320_-User-Account-Control
TITLE : Kenny Kerr - Windows Vista for Developers Part 4 User Account Control
VERIFY(::CreateProcessAsUser(duplicateToken,.......
http://weblogs.asp.net/kennykerr/Windows-Vista-for-Developers-_1320_-Part-4-_1320_-User-Account-Control
TITLE : Run as admin - AndreaVB Visual Basic and VB.NET source code discussion board
' CreateProcessAsUser() requires that the caller has the following permissions.......
http://www.andreavb.com/forum/viewtopic_4543.html
TITLE : Run as admin - AndreaVB Visual Basic and VB.NET source code discussion board
Result = CreateProcessAsUser(hToken, 0&, CommandLine, 0&, 0&, False, _.......
http://www.andreavb.com/forum/viewtopic_4543.html
TITLE : Run as admin - AndreaVB Visual Basic and VB.NET source code discussion board
MsgBox "CreateProcessAsUser() failed with error " & Err.LastDllError, vbExclamation.......
http://www.andreavb.com/forum/viewtopic_4543.html
TITLE : Starting process in the logged session under the local system account
Running process using the CreateProcessAsUser() function.......
http://www.apriorit.com/dev-blog/214-start-process-in-the-logged-session
TITLE : Starting process in the logged session under the local system account
if(!CreateProcessAsUser(hDpTokenGuard.get(), NULL, const_cast.......
http://www.apriorit.com/dev-blog/214-start-process-in-the-logged-session
TITLE : Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit
bSuccess = CreateProcessAsUser(.......
http://www.blakewatts.com/namedpipepaper.html
TITLE : CIRCL TR-25 Analysis - Turla / Pfinet / Snake/ Uroburos
L|-1|CreateProcessAsUser():%d, %s|.......
http://www.circl.lu/pub/tr-25/
TITLE : CreateLowIntegrityProcess - sir - q
if (!CreateProcessAsUser(hNewToken, NULL, pszCommandLine, NULL, NULL,.......
http://www.cnblogs.com/lzjsky/archive/2010/12/01/1893623.html
TITLE : Interaction between services and applications at user level in Windows Vista - CodeProject
BOOL result = CreateProcessAsUser(primaryToken, 0,.......
http://www.codeproject.com/Articles/36581/Interaction-between-services-and-applications-at-u
TITLE : Interaction between services and applications at user level in Windows Vista - CodeProject
If the developed software will be used only in Windows Vista and later OSs, then you can use the CreateProcessWithTokenW() function instead of CreateProcessAsUser(). It can be called, for example, in this way:.......
http://www.codeproject.com/Articles/36581/Interaction-between-services-and-applications-at-u
TITLE : Interaction between services and applications at user level in Windows Vista - CodeProject
CreateProcessAsUser(primaryToken, null, command, ref Security1,.......
http://www.codeproject.com/Articles/36581/Interaction-between-services-and-applications-at-u
TITLE : Interaction between services and applications at user level in Windows Vista - CodeProject
CreateProcessAsUser(primaryToken, 0, (LPSTR)(command.c_str()), NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, 0, &startupInfo, &processInfo);.......
http://www.codeproject.com/Articles/36581/Interaction-between-services-and-applications-at-u
TITLE : Windows Service Cannot Create Process or - C++ Forum
If it is so, then you cannot launch child processes in interactive desktop. There is a way by "stealing" autentication token from a process that already runs there (explorer.exe for example or winlogon.exe if you want administrator rights without UAC intervention) and then spawn the child process as usual using CreateProcessAsUser()........
http://www.cplusplus.com/forum/windows/105447/
TITLE : Windows Service Cannot Create Process or - C++ Forum
So Modoran, how would I use that technique using CreateProcessAsUser() to spawn a process? Would I just use the admin user or what? I don't want users to have to change a bunch of settings to get it to work........
http://www.cplusplus.com/forum/windows/105447/
TITLE : Windows Service Cannot Create Process or - C++ Forum
So Modoran, how would I use that technique using CreateProcessAsUser() to spawn a process?.......
http://www.cplusplus.com/forum/windows/105447/
TITLE : CreateProcessAsUser fast user switching - Delphi Pages Forums
CreateProcessAsUser(nToken, nil, PChar(FileName), nil, nil, False,.......
http://www.delphipages.com/forum/showthread.php@t=197902
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
CreateProcessAsUser() Window Stations and Desktops Program Example.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
When a process is started by means of the CreateProcessAsUser() function, the process will be started into a window station and desktop combination based on the value of lpDesktop in the STARTUPINFO structure parameter:.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
CreateProcessAsUser(hToken, NULL, szCmdline, /*...*/ );.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls CreateProcessAsUser() using the Program Files directory will run this application instead of the intended application. To avoid this problem, do not pass NULL for lpApplicationName. If you do pass NULL for lpApplicationName, use quotation marks around the executable path in lpCommandLine, as shown in the code snippet example below........
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
CreateProcessAsUser(hToken, NULL, szCmdline, /*...*/);.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
if (!CreateProcessAsUser(.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
wprintf(L"CreateProcessAsUser() failed, error %d!\n", GetLastError());.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : The CreateProcessAsUser() Window Stations and Desktops Win32 program example
wprintf(L"CreateProcessAsUser() is pretty OK!\n");.......
http://www.installsetupconfig.com/win32programming/windowstationsdesktops13_4.html
TITLE : Create Process As User : Process « Development Class « C# / C Sharp
CreateProcessAsUser(IntPtr hToken, string lpApplicationName, string lpCommandLine,.......
http://www.java2s.com/Code/CSharp/Development-Class/CreateProcessAsUser.htm
TITLE : Create Process As User : Process « Development Class « C# / C Sharp
public static void CreateProcessAsUser(string username, string domain, string password, string commandLine).......
http://www.java2s.com/Code/CSharp/Development-Class/CreateProcessAsUser.htm
TITLE : Create Process As User : Process « Development Class « C# / C Sharp
result = CreateProcessAsUser(.......
http://www.java2s.com/Code/CSharp/Development-Class/CreateProcessAsUser.htm
TITLE : Calling CreateProcessWithLogonW - ASP.NET Security
' CreateProcessAsUser() requires that the caller has the following.......
http://www.justskins.com/forums/calling-createprocesswithlogonw-74440.html
TITLE : Calling CreateProcessWithLogonW - ASP.NET Security
> ' CreateProcessAsUser() requires that the caller has the following.......
http://www.justskins.com/forums/calling-createprocesswithlogonw-74440.html
TITLE : pinvoke.net: createprocessasuser (advapi32)
static extern bool CreateProcessAsUser(.......
http://www.pinvoke.net/default.aspx/advapi32.createprocessasuser
TITLE : pinvoke.net: createprocessasuser (advapi32)
Private Shared Function CreateProcessAsUser( _.......
http://www.pinvoke.net/default.aspx/advapi32.createprocessasuser
TITLE : pinvoke.net: createprocessasuser (advapi32)
if (!CreateProcessAsUser(hToken, String.Empty, commandLine,.......
http://www.pinvoke.net/default.aspx/advapi32.createprocessasuser
TITLE : pinvoke.net: createprocessasuser (advapi32)
If Not CreateProcessAsUser(hToken, "", strCmdLine, Nothing, _.......
http://www.pinvoke.net/default.aspx/advapi32.createprocessasuser
TITLE : Python win32process.CreateProcess Examples
procHandles = win32process.CreateProcessAsUser(hUser, *procArgs).......
http://www.programcreek.com/python/example/8489/win32process.CreateProcess
TITLE : Querying a user token under 64 bit version of 2003/XP | Remko Weijnen's Blog (Remko's Blog)
This seems to all work perfectly for the first time a user logs in, but when that same user logs out then back in again the CreateProcessAsUser() when passed with the token returns zero but the process doesnt start........
http://www.remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/
TITLE : Querying a user token under 64 bit version of 2003/XP | Remko Weijnen's Blog (Remko's Blog)
Initially the WTSQueryUserToken was giving me an insufficient buffer (as per this post) which with your help we were able to solve. We start the program by performing your implementation of GetUserToken() on the appropriate session ID (i.e. the one thatfs just logged in), then pass this token to CreateProcessAsUser() starting our application (happens to be the same EXE) with a command line switch to start the recording in the usersf session........
http://www.remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/
TITLE : Querying a user token under 64 bit version of 2003/XP | Remko Weijnen's Blog (Remko's Blog)
I am testing for gif not CreateProcessAsUser()h as to whether there is a problem, this CreateProcessAsUser() returns false (i.e. zero) on the second time gUser nh logs in (i.e. when the process doesnt open)........
http://www.remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/
TITLE : Querying a user token under 64 bit version of 2003/XP | Remko Weijnen's Blog (Remko's Blog)
So, basically the first time any given user logs in it works fine, then when they log out and log back in CreateProcessAsUser() appears to do nothing........
http://www.remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/
TITLE : Querying a user token under 64 bit version of 2003/XP | Remko Weijnen's Blog (Remko's Blog)
One other weird thing is when I restart the service it resets it so that users can be logged the first time again. I thought if I ripped the GetUserToken() and CreateProcessAsUser() stuff into a separate EXE that was called then closed Ifd be OK, itfs as though the separate EXE which is called from the service using CreateProcess() is somehome linked to the parent process and as such still keeps hold of the pipe or whatever it is which is connected to that user........
http://www.remkoweijnen.nl/blog/2011/01/29/querying-a-user-token-under-64-bit-version-of-2003xp/
TITLE : Starting a process in any given Windows Terminal Session via C# and P/Invoke | blog @ solid-hosting.net
On to the core function now the single most important function here is CreateProcessAsUser():.......
http://www.solid-hosting.net/blog/coding/starting-a-process-in-any-given-windows-terminal-session-via-c-and-pinvoke/
TITLE : Starting a process in any given Windows Terminal Session via C# and P/Invoke | blog @ solid-hosting.net
[DllImport(gadvapi32.dllh, SetLastError = true, CharSet = CharSet.Auto)] public static extern bool CreateProcessAsUser( IntPtr hToken, string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);.......
http://www.solid-hosting.net/blog/coding/starting-a-process-in-any-given-windows-terminal-session-via-c-and-pinvoke/
TITLE : Starting a process in any given Windows Terminal Session via C# and P/Invoke | blog @ solid-hosting.net
if (!CreateProcessAsUser(uToken, null, sCommandLine, ref saProcessAttributes, ref saThreadAttributes, false, 0, IntPtr.Zero, null, ref si, out pi)) { // Throw exception err = Marshal.GetLastWin32Error(); CloseHandle(uToken);.......
http://www.solid-hosting.net/blog/coding/starting-a-process-in-any-given-windows-terminal-session-via-c-and-pinvoke/
TITLE : Starting a process in any given Windows Terminal Session via C# and P/Invoke | blog @ solid-hosting.net
Finally, the very call to CreateProcessAsUser() is made the program to be started is passed in the sCommandLine variable and the PROCESS_INFORMATION structure is returned........
http://www.solid-hosting.net/blog/coding/starting-a-process-in-any-given-windows-terminal-session-via-c-and-pinvoke/
TITLE : Starting a process in any given Windows Terminal Session via C# and P/Invoke | blog @ solid-hosting.net
CreateProcessAsUser() requires an active session into which to spawn a process, so if you do not have such on the machine then you can create one ? see this article on SO........
http://www.solid-hosting.net/blog/coding/starting-a-process-in-any-given-windows-terminal-session-via-c-and-pinvoke/
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser().......
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
If the calling process is impersonating another user, the new process uses the token for the calling process, not the impersonation token. To run the new process in the security context of the user represented by the impersonation token, use the CreateProcessAsUser() or CreateProcessWithLogonW() function........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser().......
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser()........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
BOOL CreateProcessAsUser( HANDLE hToken, LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);.......
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
If the executable module is a 16-bit application, lpApplicationName should be NULL, and the string pointed to by lpCommandLine should specify the executable module as well as its arguments. By default, all 16-bit Windows-based applications created by CreateProcessAsUser() are run in a separate VDM (equivalent to CREATE_SEPARATE_WOW_VDM in CreateProcess())........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser() does not load the specified user's profile into the HKEY_USERS registry key. Therefore, to access the information in the HKEY_CURRENT_USER registry key, you must load the user's profile information into HKEY_USERS with the LoadUserProfile() function before calling CreateProcessAsUser()........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
If the lpEnvironment parameter is NULL, the new process inherits the environment of the calling process. CreateProcessAsUser() does not automatically modify the environment block to include environment variables specific to the user represented by hToken. For example, the USERNAME and USERDOMAIN variables are inherited from the calling process if lpEnvironment is NULL. It is your responsibility to prepare the environment block for the new process and specify it in lpEnvironment........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser(hToken, NULL, "C:\\Program Files\\MyApp", ...).......
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls CreateProcessAsUser() using the Program Files directory will run this application instead of the intended application........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
CreateProcessAsUser(hToken, NULL, "\"C:\\Program Files\\MyApp.exe\" -L -S", ...).......
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
To create a new process and its primary thread. The new process then runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for the specified user. The CreateProcessWithLogonW() and CreateProcessWithTokenW() functions are similar to the CreateProcessAsUser() function, except that the caller does not need to call the LogonUser() function to authenticate the user and get a token........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
This function is similar to the CreateProcessWithLogonW() and CreateProcessAsUser() functions. This function and CreateProcessWithLogonW() do not require a call the LogonUser() function to authenticate the user and get a token........
http://www.tenouk.com/crstufunction1.html
TITLE : The C programming for Windows operating system processes and threads: the win32 APIs - structures, functions and macros definitions
To create a new process and its primary thread. The new process then runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for the specified user. The CreateProcessWithLogonW() and CreateProcessWithTokenW() functions are similar to the CreateProcessAsUser() function, except that the caller does not need to call the LogonUser function to authenticate the user and get a token........
http://www.tenouk.com/crstufunction1.html
TITLE : Adjust memory quotas for a process
Other research shows this right is required for what would seem unrelated actions such as starting a process under a different user account with CreateProcessAsUser() API. http://support.microsoft.com/kb/285879.......
http://www.ultimatewindowssecurity.com/wiki/WindowsSecuritySettings/Adjust-memory-quotas-for-a-process
TITLE : Carbon Paper: Peering into Turlafs second stage backdoor
* 3 = execution in the security context of the user represented by the gexplorer.exeh token (the token of the process gexplorer.exeh is duplicated and passed through the CreateProcessAsUser() function........
http://www.welivesecurity.com/2017/03/30/carbon-paper-peering-turlas-second-stage-backdoor/
TITLE : Carbon Paper: Peering into Turlafs second stage backdoor
* 4 = similar than 3 but the environment variables for the user represented by the gexplorer.exeh token are retrieved and passed to the function CreateProcessAsUser().......
http://www.welivesecurity.com/2017/03/30/carbon-paper-peering-turlas-second-stage-backdoor/
search Google

https://www.google.com/#q=CreateProcessAsUser