I'm trying to run this script with an advanced domain user, but when compiling the cmd it returns access denied, as if it did not recognize the user of AD.
RunAsWait("administrator", "CONTOSO", "Services.1", 2, "C:\Users\albert.frizz\Desktop\test.bat")
can you help me please?
I have a question
about the display language of the system
How can I get the current display language and how can I change it by autoit
Of course, if this is possible
Greetings to all and hope you help me
I'm making an app that among other things has the system info feature, where it displays stuff like the system version, build, CPU and ram stats, etc.
So, I haven't been able to find anywhere a way to access the following things (is there even?):
Windows version (not like WIN_10, but the version like 1607, or 1511 Windows edition like professional, home, education, etc. information whether the Windows is registered or not (optionally the registrant's name) the type of the currently logged-in user (e.g., administrator) computer manufacturer and model (e.g., dell inc. Inspiron n5110 boot mode (e.g., safe, normal) CPU tempreture I'd appreciate a lot if any of you could help me with any of the things from above; it would mean a lot to me.
Have a great day.
I have a problem, I cant run script as administrator in Windows 10:
Global $sUserName = "administrator"
Global $sPassword = "pass"
Global $sDomain = "domain"
RunAsWait($sUserName, $sDomain, $sPassword, 2, "main.exe", "", @TempDir)
If I run "run.exe" it dont work...
If I change main.exe to this:
and it runs and shows administrator in message box... but it cant elevate main.exe with RegWrite() command...
I tried using #RequireAdmin in first line of main.exe, but it not worked... UAC is set to "do not notify"
This method of elevation worked on Windows 7 and Windows XP...
I've been using this UDF to set ACL permissions to some network folders, everything works great (no issues). However, I want to apply these permissions using elevated domain credentials supplied by the user and not the user that's currently running the script. As a temporary solution, I've implemented a RunAs function, but that's not the solution I'm looking for. I'm not fluent with using Dlls, but I have been trying out different methods.
My RunAs Function:
Func _RunAs($sUser, $sPass) If @Compiled Then RunAs($sUser, @LogonDomain, $sPass, 4, FileGetShortName(@ScriptFullPath), "", @SW_MAXIMIZE) Else RunAs($sUser, @LogonDomain, $sPass, 4, FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath), "", @SW_MAXIMIZE) EndIf EndFunc ;==>_RunAs I tried LogonUser and I know that I can take that token to ImpersonateLoggedOnUser, but I'm not sure how to implement that or if that's even the right method. I also need to RevertToSelf once completed.
Func _LogonUser($sUsername, $sPassword, $sServer = @LogonDomain) ; Returns True if user exists Local $stToken $stToken = DllStructCreate("int") Local $aRet = DllCall("advapi32.dll", "int", "LogonUser", _ "str", $sUsername, "str", $sServer, "str", $sPassword, "dword", 3, "dword", 0, "ptr", DllStructGetPtr($stToken)) ;$hToken = DllStructGetData($stToken, 1) If Not @error And $aRet <> 0 Then Return True EndIf Return False EndFunc ;==>_LogonUser Any assistance, suggestions or idea's would be helpful.