First thing thank you for the replys, ive tryied to implement the code as below, but im still running into problems:
1st Massage box : i get Number: 227633266688 this is a random number:
2nd Massage box : i get Number: 25769803776
then i get an Error message "Error opening file for writing"
So i wondering if this is a permission thing? - not so sure of this as TestAdmin have full access rights on the c:\
PHP Code:
### User Impersanation
!define USERNAME "TestAdmin"
!define DOMAIN "WIN-UJOVINKT6SI"
!define PASSWORD "password1"
!define LOGON32_LOGON_INTERACTIVE 2
!define LOGON32_LOGON_NETWORK 3
!define LOGON32_LOGON_BATCH 4
!define LOGON32_LOGON_SERVICE 5
!define LOGON32_LOGON_UNLOCK 7
!define LOGON32_LOGON_NETWORK_CLEARTEXT 8
!define LOGON32_LOGON_NEW_CREDENTIALS 9
!define LOGON32_PROVIDER_DEFAULT 0
!define LOGON32_PROVIDER_WINNT35 1
!define LOGON32_PROVIDER_WINNT40 2
!define LOGON32_PROVIDER_WINNT50 3
!define LogonUser "advapi32::LogonUserA(t, t, t, i, i, *l) l"
!define ImpersonateLoggedOnUser "advapi32::ImpersonateLoggedOnUser(l)l"
!define RevertToSelf "advapi32::RevertToSelf() l"
Section "App Applications" App_Applications
SetPluginUnload alwaysoff
System::Call '${RevertToSelf}.r0'
System::Call "${LogonUser}('${USERNAME}', '${DOMAIN}', '${PASSWORD}', ${LOGON32_LOGON_INTERACTIVE}, ${LOGON32_PROVIDER_DEFAULT}, .r2) .r0"
messagebox mb_ok $0
System::Call '${ImpersonateLoggedOnUser}(r2) .r0'
messagebox mb_ok $0
setOutPath $INSTDIR\App_Applications
#Program Files
file /r "C:\App_Platform\Output\Debug\"
System::Call '${RevertToSelf}.r0'
SectionEnd