Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WinExec and Administrators privileges
Message
De
19/11/2007 16:21:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01269892
Message ID:
01270014
Vues:
20
Hi Cristof
I'v got an error
#DEFINE LOGON_NETCREDENTIALS_ONLY 0x00000002
#DEFINE CREATE_DEFAULT_ERROR_MODE 0x04000000
#DEFINE START_INFO_SIZE 68
DECLARE INTEGER CreateProcessWithLogonW IN Advapi32;
    STRING    lpUsername,;
    STRING    lpDomain,;
    STRING    lpPassword,;
    INTEGER   dwLogonFlags,;
    STRING    lpAppName,;
    STRING    lpCmdLine,;
    INTEGER   dwCreationFlags,;
    INTEGER   lpEnvir,;
    STRING    lpCurDir,;
    STRING  @ lpStartupInfo,;
    STRING  @ lpProcessInfo

    cStartInfo = PADR(Chr(START_INFO_SIZE),START_INFO_SIZE, Chr(0))
    cProcInfo = Repli(Chr(0), 16)
lnResult = CreateProcessWithLogonW("Administrator",;
"myDomain",;
"MyPassword$",;
LOGON_NETCREDENTIALS_ONLY,;
"",;
"D:\\SubFolder2\\gear_305_st.exe",;
0,;
0,;
"",;
cStartInfo,;
cProcInfo)
return 0...
Have you got an idea what might be wrong there?

Thanks
Denis


>Hi Denis,
>
>>The question is - Is it possible to run process under another (admin) user privileges?
>
>You could use the CreateProcessWithLogonW API function:
>
>http://www.news2news.com/vfp/?group=-1&function=696
>http://msdn2.microsoft.com/en-us/library/ms682431.aspx
>
>You need the user name and password, though.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform