how i can to read windows user and Password
thank
how i can to read windows user and Password
thank
Why would you want to know the user’s password?
i believe at windows you can only reset password if you logged in with administrator permissions.
i no want delete user password but only for have adminstator permissions with my softwre for register and unregister my dll
Here’s a link that elevates a helper app to admin privileges:
https://forum.xojo.com/2933-shell-command-in-adminstrator-mode
You shouldn’t be going near their password. If you want some code that doesn’t show the regsvr32 call here’s some old code I wrote many moons ago:
[code]Public Function RunAs(filename As String, ParamArray Parameters As String) as Integer
'Declares created using https://forum.xojo.com/47389-xojo-ide-reformat-code-script or https://blog./2017/01/22/windows-to-xojo-data-type-conversion/
'See https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx for more error messages and flags
'More info at https://docs.microsoft.com/en-gb/windows/desktop/api/shellapi/ns-shellapi-_shellexecuteinfoa
'I have added all the error messages here so you can add extra functionality if you require it
Const SE_ERR_FNF = 2 'file not found
Const SE_ERR_PNF = 3 'path not found
Const SE_ERR_ACCESSDENIED = 5 'access denied
Const SE_ERR_OOM = 8 'out of memory
Const SE_ERR_SHARE = 26 'Cannot share an open file
Const SE_ERR_ASSOCINCOMPLETE = 27 'File association information not complete
Const SE_ERR_DDETIMEOUT = 28 'DDE operation timed out
Const SE_ERR_DDEFAIL = 29 'DDE operation failed
Const SE_ERR_DDEBUSY = 30 'DDE operation is busy
Const SE_ERR_NOASSOC = 31 'File association not available
Const SE_ERR_DLLNOTFOUND = 32 'Dynamic-link library not found
'flags - See https://docs.microsoft.com/en-gb/windows/desktop/api/shellapi/nf-shellapi-shellexecutea
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Dim ok As Integer
Dim params As String = Join(Parameters, " ")
Soft Declare Function ShellExecute Lib “Shell32” Alias “ShellExecuteW” (hwnd As Integer, lpOperation As WString, lpFile As WString, lpParameters As WString, lpDirectory As WString, nShowCmd As Int32) As Integer
ok = ShellExecute(0, “RunAS”, filename, params, “”, SW_HIDE)
'We could do something fancy here
If ok > 32 Then
'everything worked
system.DebugLog(“Elevation worked!”)
Else
Select Case ok
Case SE_ERR_ACCESSDENIED
'User declined elevation
system.DebugLog(“User declined elevation”)
Else
'Something else went wrong
system.DebugLog(“Uh oh!”)
End Select
End If
'Or we just could just return the result so the caller can handle the error
Return ok
End Function
[/code]
This will pop up the UAC if the user has it enabled, if not it will just elevate.
Do that in the installer.
All Windows installers have an option to register a DLL after it has been installed.