Jump to content

malcolmsearle

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by malcolmsearle

  1. arcker - just found this post after a bit of Googling. Wanted to say thanks. I was getting error -2147221008 when running DllCall("C:WINDOWSSome.DLL", "long", "DllRegisterServer"). I wanted to register 15 DLLs in an AutoIt script, but could only register 14 of them. My searches showed that this error is related to CoInitialize not being called. I added the line you specified, i.e. DllCall('ole32.dll', 'long', 'CoInitializeEx', 'ptr', 0, 'dword', $COINIT_APARTMENTTHREADED) before my call to DllRegisterServer and the error went away. Thank you!!!
  2. So that line 85 which was: Return _Security__StringSidToSid($aAcct[0]) is replaced by : If IsArray($aAcct) Then Return _Security__StringSidToSid($aAcct[0]) Return '' I have added this info to the ticket.
  3. Which you could have said to start with. It was my initial question. This bug is similar to closed ticket 1393. I have made a new bug report, number 1920.
  4. Ok. Would you be kind enough to give an example? So I could learn from it.
  5. One workaround involves skipping Security.au3 and calling AdFind from a command prompt like this: While $strSid = "" ; Grab the user's DN from Active Directory $strDn = _GetUserAttribute($strSamid, "distinguishedName") ; _GetUserAttribute, my own function to get a single user attribute $strOutput = "" $strTemp = "" ; Use adFind to grab the user's SID from Active Directory $hDOS = Run(@ComSpec & ' /k ' & 'AdFind.exe -b "' & $strDn & '" objectsid', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ProcessWaitClose($hDOS) While 1 $strTemp = StdoutRead($hDos) If @error Then ExitLoop $strOutput = $strOutput & $strTemp Wend $arrTemp = StringSplit($strOutput, @CRLF) ; Convert the AdFind output to an array $intI = _ArraySearch($arrTemp, ">objectSid:", 0, 0, 0, 1) ; Locate the substring ">objectSid:" in this array; here we'll find the SID If Not @error Then $strSid = StringReplace($arrTemp[$intI], ">objectSid: ", "") ; Store the SID in the string $strSid If Not StringLeft($strSid, 3) = "S-1" Then $strSid = "" ; Does $strSid start with "S-1"? If not, blank it to loop once more Wend This works quite nicely. However in testing I noticed that this is around a second slower than an equivalent call to _Security__GetAccountSid. But as I said before, sometimes _Security__GetAccountSid fails so a slightly slower script is to be preferred!
  6. I wonder if I may have found an error with Security.au3. I make a call to _Security__GetAccountSid like this: $bSid = _Security__GetAccountSid($strDomainName & "\" & $strSamid, $strLogonServer)9 times out of 10 I get back a struct but occasionally my script bottoms out saying: C:\Program Files (x86)\AutoIt3\Include\Security.au3 (85) : ==> Subscript used with non-Array variable.: Return _Security__StringSidToSid($aAcct[0]) Return _Security__StringSidToSid($aAcct^ ERROR ->11:34:57 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 174.220 On the lines after the call to _Security__GetAccountSid I check @error before calling IsDllStruct but these lines never get parsed if my script bottoms out as mentioned above. Any ideas as to a workaround or should I make a bug report? Thanks in advance for any pointers. Malcolm
  7. Yes! When I comment out #RequireAdmin and then start ScITE as an admin and run my script from there then the console displays just like it always did under XP and doesn't display "Exit" until I actually close the GUI. Thanks for the heads up!
  8. Thanks for the replies. My script shows a GUI that can be used for creating new users in Active Directory. The GUI is displayed and can be used even after the console output shows that it has ended. Will check out the thread mentioned.
  9. Hi I'm on Windows 7, ScITE 1.79, AutoIt v3.3.6.1. I have a script that I am trying to debug. When I run it with F5 in ScITE it starts fine but AutoIT3.exe ends whilst the script is still running. Here's the console output. Any ideas? Thanks Malcolm "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\g19495a\Links\dev\src\AutoIt\CreateUser64.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams +>16:13:10 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000406 OS:WIN_7/ CPU:X64 OS:X64) >Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3 +>16:13:11 AU3Check ended.rc:0 >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\g19495a\Links\dev\src\AutoIt\CreateUser64.au3" +>16:13:18 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 9.266
  10. You were right, doesn't work on top-level windows :-( At this point I think I will have to stop looking for a solution. This is not a show-stopper, just more of a would-be-nice-to-have. Thanks to all for your input. If, of course, anyone does come up with an idea please add it to this thread. Cheers.
  11. Had a read. Not sure that was what I was after. I need something more like this method that is available through the WindowsAPICodePack on Win 7: SetApplicationIdForSpecificWindow Doesn't matter if I can't get this to work on XP, we're moving to Win 7 this last quarter of 2010 anyway. Anyone have any experience doing this in AutoIt?
  12. Thanks a lot. I'll check it out and post back here with an update later on.
  13. Thanks but that's not quite what I'm looking for. If, for example, I start 5 copies of Word then they will all get grouped into one button (my Windows groups after 3 windows are open for any one specific app). I would like to have the same happen for my "Script Central" scripts. This might not be possible as they all have different file names. If I start 3 copies of the same script they get grouped. But I would like to group other my scripts too under one "Script Central" button. Can I set some sort of application identifier in my scripts that would cause Windows to do this?
  14. Hi I have produced a bunch of AutoIt scripts to improve my, and my teammates, productivity at work. Spent many hours browsing these forums and reading the helpfiles in order to be able to do that. Impressive, good info everywhere, thanks for that! But maybe I've missed something... A number of my scripts are part of a suite that we call "Script Central". What I would like to be able to do is to be able to have Windows (some of us are on XP, some of us have moved to Windows 7) group any open "Script Central" applications on the taskbar. Note that I don't want to force Windows to group open "Script Central" windows, I just want Windows to use it's own grouping settings to group all open "Script Central" windows when it deems it necessary. I've searched through the help files and this forum but come up short. Can anyone point me in the right direction? Sorry if I've misunderstood something very basic! Cheers Malcolm
×
×
  • Create New...