FoxPro sample code (members area)
How to Start a Process as Another User (NT/XP/2K)http://www.news2news.com/vfp/?example=426&function=696API functions used:
CloseHandle
CreateProcessAsUser
CreateProcessWithLogonW
GetLastError
GetVersionEx
LogonUser
To start a process as another user the
LogonUser and
CreateProcessAsUser Win32 APIs can be used when running Microsoft Windows NT 4.0 or the
CreateProcessWithLogonW Win32 API when running Microsoft Windows 2000/XP or later version.