caramen Posted October 9, 2020 Posted October 9, 2020 (edited) Func _PsExec1() ;~ local $iResult Run( @ComSpec & ' /c mkdir \\PC-Portable\c$\temptest', @SystemDir, @SW_SHOW ) If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended) RunAsWait( "Caramen" , @ComputerName , "@jhgjfjhf" ,$RUN_LOGON_PROFILE , @ComSpec & '/k /c dircopy '&@ScriptDir&'\Data\Source1'&' \\PC-Portable\c$\temptest', @SystemDir, @SW_SHOW) If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended) RunAsWait( "Administrateur" , @ComputerName , "" ,$RUN_LOGON_PROFILE , @ComSpec & '/k /c PSEXEC \\PC-Portable -u Caramen -p XXXXXX "c:\temptest\test.txt"', @SystemDir, @SW_SHOW) If @error <> 0 Then MsgBox(16, "Erreur", "Erreur: @error = " & @error & ", @extended: " & @extended) EndFunc Hello, Why the both commands RunAsWait doing this error please ? I think I had the same problem before. I can't remember how we solved it. Edited October 9, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
caramen Posted October 9, 2020 Author Posted October 9, 2020 (edited) Oh wow... I discovered this can fail if I have no password set on the system account. A policy say : Don't allow empty password. And then if you use RunAs with empty password when this policy is (by default (Is that new WTF ?)) enable then RunAs will fail. <Good info for help file. Edit : Windows 10 Edited October 9, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Subz Posted October 9, 2020 Posted October 9, 2020 (edited) You also have no space between @Comspec & '/k...', also is PsExec.exe been added to a searchable path? From memory Windows has always required a password (for connecting to shares) otherwise it would be a major security risk. Edited October 9, 2020 by Subz
pixelsearch Posted October 10, 2020 Posted October 10, 2020 Hi caramen I found a web site indicating thirteen different extended error values, related to RunAs and RunAsWait. It includes your extended error value 1326 : "1326 (0x0000052e) ERROR_LOGON_FAILURE - The user name or password is incorrect." Here is the link, in case it may help anyone in the future :https://www.vanstechelman.eu/content/meaning-of-the-extended-flag-value-when-using-autoits-runas-and-runaswait "I think you are searching a bug where there is no bug... don't listen to bad advice."
caramen Posted October 10, 2020 Author Posted October 10, 2020 (edited) Yo @Subz yeah I forgot about that, it's now all corrected. but still same issue. Hi @pixelsearch yeah it return 1326 with policy enable and 1327 is the policy not enable but password isn't same as on target computer with the same account. So my way to correct was to change my password and add " " before "/k" to enable my test environment. And not to disable the policy because I don't have empty password anymore, but the same as my target computer with same account. It was Microsoft related so... Edited October 10, 2020 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now