Jump to content

kiboost

Active Members
  • Posts

    193
  • Joined

  • Last visited

Everything posted by kiboost

  1. Hi, I'm using this code for years in python 2.7 x64 and it works fine: from win32com.client import Dispatch # AutoIt python binding autoit = Dispatch("AutoItX3.Control") if autoit.WinExists("[CLASS:#32770]") title = autoit.WinGetTitle("[CLASS:#32770]") Now, with python 3.6 x64, WinExists find the class, but WinGetTitle just return an empty string. If I pass a string title (not [CLASS:...], WinGetTitle return a correct title string Am I missing something ? Thanks
  2. I may have some configuration somewhere in autoit3 folder ... On a working machine with 3.3.12.0: - If I install 3.3.14.2 with installer, no problem (without reinstalling scite). - If I download the zip package, delete my C:\autoit3\ folders and files and get them back from the zip, it doesn't work. RegRead works on some keys, but not all. Really strange... But seems not an autoit problem, more something with my configs, maybe scite one.
  3. very strange thing, I copy entire autoit3 folder from another machine in v3.3.12.0 and now it works ! will try with 3.3.14 ...
  4. Same in 3.3.14.1 / 3.3.14.2
  5. Hi, I just updated from v3.3.12 to v3.3.14 and now RegRead can't read some registry value it could before. Example for vdredist 2005_sp1 x64 MFC: $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}", "DisplayVersion") ConsoleWrite(@error&@CR) => error 1 = unable to open requested key No problem at all with v3.3.12 and previous. Is there any deprecated/new stuff regarding RegRead ?
  6. Yes I had a look into this, ut always have a message that machine miss a privilege for this. When autoit runas works on same machine :/
  7. Hi, I use a lot RunAs in autoit, for example to import some reg file when in a user session (win7 x64) or starting bat file. All in a private local network of course, knowing all domain and user accounts. I'm now trying to write such function in python, basically running a command (subprocess or whatever) as another user with passing domain, username, password. I can't find how to do it in python, so any insight on how autoit does it whould be nice. What does autoit RunAs do under the hood ? Thanks
  8. Yes the process run fine. Didn't tried return code, will do. Anyway, I've changed all these to RunAsWait and RunWait and seems lot better. Just there is no timeout, but I can live with that. I never had such problem with previous autoit version so I really suspect a bug here !
  9. Hi, Since upgraded to autoit 3.3.10.2 (from 3.3.6.1) these funtions seems to not work at all. example, I have several such check to install vcredists : ; vcredist 2005_sp1 x64 MFC $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ad8a2fa1-06e7-4b0d-927d-6e54b3d31028}", "DisplayVersion") If $var <> "8.0.61000" Then $command = '\\GANESH\Ressources\Repository\GlobalNetwork\VCredist\Microsoft_VC_2005_SP1_MFC\vcredist_x64.EXE /q' RunAs($Loginadmin, @ComputerName, $Passadmin, 0, $command, @SystemDir, @SW_HIDE) ProcessWait("vcredist_x64.EXE", 400) ProcessWaitClose("vcredist_x64.EXE", 400) _report("Installed vdredist 2005_sp1 x64 MFC") EndIf ; vcredist 2005_sp1 x86 MFC $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{710f4c1c-cc18-4c49-8cbf-51240c89a1a2}", "DisplayVersion") If $var <> "8.0.61001" Then $command = '\\GANESH\Ressources\Repository\GlobalNetwork\VCredist\Microsoft_VC_2005_SP1_MFC\vcredist_x86.EXE /q' RunAs($Loginadmin, @ComputerName, $Passadmin, 0, $command, @SystemDir, @SW_HIDE) ProcessWait("vcredist_x86.EXE", 400) ProcessWaitClose("vcredist_x86.EXE", 400) _report("Installed vcredist 2005_sp1 x86 MFC") EndIf or : $Command = 'ROBOCOPY "mysourcepath" "mydestpath" /E' $PID = RunAs($Loginadmin, @ComputerName, $Passadmin, 0, $Command, @SystemDir, @SW_HIDE) ProcessWaitClose($PID, 200) in both cases, all command goes all in a few milliseconds, not waiting previous ProcessWaitClose What's wrong with such code ??
  10. Seems I was not usng the right value Global Const $SPI_GETNONCLIENTMETRICS = 0x0029 Global Const $SPI_SETNONCLIENTMETRICS = 0x002A Global Const $SPIF_UPDATEINIFILE = 0x0001 Global Const $SPIF_SENDWININICHANGE = 0x0002 Global Const $SPIF_SENDCHANGE = $SPIF_SENDWININICHANGE Global Const $SPI_SETBORDER = 0x0006 $nonclientmetrics = DllStructCreate("uint;int;int;int;int;int;byte[60];int;int;byte[60];int;int;byte[60];byte[60];byte[60]") DLLStructSetData($nonclientmetrics,1,DllStructGetSize($nonclientmetrics)) ;initialize values to not reset all others ! $a = DLLCall("user32.dll","int","SystemParametersInfo","int",$SPI_GETNONCLIENTMETRICS, _ "int",DllStructGetSize($nonclientmetrics), _ "ptr",DllStructGetPtr($nonclientmetrics),"int",0) DllStructSetData($nonclientmetrics, $SPI_SETBORDER, 15) ;force refresh ! $a = DLLCall("user32.dll","int","SystemParametersInfo","int",$SPI_SETNONCLIENTMETRICS, _ "int",DllStructGetSize($nonclientmetrics), _ "ptr",DllStructGetPtr($nonclientmetrics),"int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))
  11. I came with this with lot of inspiration from code here and there, but it doesn't change anything (the ui refresh anyway) ; $SM_CYSIZE : The height of a button in a window caption or title bar, in pixels. Global Const $SM_CYSIZE=31 Global Const $SPI_GETNONCLIENTMETRICS = 41 Global Const $SPI_SETNONCLIENTMETRICS = 42 Global Const $SPIF_SENDCHANGE = 2 Global Const $SPIF_UPDATEINIFILE = 1 $nonclientmetrics = DllStructCreate("uint;int;int;int;int;int;byte[60];int;int;byte[60];int;int;byte[60];byte[60];byte[60]") DLLStructSetData($nonclientmetrics,1,DllStructGetSize($nonclientmetrics)) ;initialize values to not reset all others ! $a = DLLCall("user32.dll","int","SystemParametersInfo","int",$SPI_GETNONCLIENTMETRICS, _ "int",DllStructGetSize($nonclientmetrics), _ "ptr",DllStructGetPtr($nonclientmetrics),"int",0) ;$b = DLLCall("kernel32.dll","int","GetLastError") ;ConsoleWrite('error: '&$b&@CR) DllStructSetData($nonclientmetrics, $SM_CYSIZE, 15) ;force refresh ! $a = DLLCall("user32.dll","int","SystemParametersInfo","int",$SPI_SETNONCLIENTMETRICS, _ "int",DllStructGetSize($nonclientmetrics), _ "ptr",DllStructGetPtr($nonclientmetrics),"int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))
  12. Hi, I see how to get windows metrics, but how to set them ? I can load a reg file to set them, but have to close/reopen session to have them loaded. I'm looking for a way to force immediate change, just like changing them with UI. Win7 x64 #include <APIConstants.au3> #include <WinAPI.au3> $ActiveBarSize = _WinAPI_GetSystemMetrics($SM_CYSIZE) ConsoleWrite('size: '&$ActiveBarSize&@CR) Any idea ?
  13. If WinExists("[CLASS:#32770]") Then ControlSetText("[CLASS:#32770]", "", "[CLASS:Edit; INSTANCE:1]", "J:\") ControlSend("[CLASS:#32770]", "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}") EndIf
  14. Hi, I have a bunch of softwares, like photoshop cs6 for instance, hich still use old winXP style open and save as dialog. I would like to create a script that change the path of these dialog. Actually I can get the window and send the control some stuff, but dunno how to send him to change path : If WinExists("[CLASS:#32770]") Then ConsoleWrite("got one"&@CR) ControlSend("[CLASS:#32770]", "", "[CLASS:SysListView32]", "J:\") EndIf Any idea ? Thanks
  15. johnmcloud, you win ! Works perfectly from admin netlogon ! Also works with python ;-) Many thanks for your help !!!
  16. WOW Works perfectly on win7pro x64 Will test executing it from domain logon script (executed by system)
  17. well, I would need four or five such shortcut, so I could create them on the fly from logon startscript, and then just use them without creating/deleting them. Not a very nice way but should work.
  18. Try this : #include <File.au3> Func RunFromExplorer($exePath = "") If $exePath = "" Then Return Local $szDrive, $szDir, $szFName, $szExt $paths = _PathSplit($exePath, $szDrive, $szDir, $szFName, $szExt) $workingPath = $szDrive&$szDir ConsoleWrite($workingPath&@CR) $HotKey = "^!j" ; CTRL + ALT + U $shortcutPath = @DesktopDir & "\TmpLauncher.lnk" FileCreateShortcut($exePath, $shortcutPath, $workingPath, "", "", $exePath, $HotKey, "0", @SW_SHOWNORMAL); create a shortcut Send($HotKey) ; send the combination of key for open the software sleep(500) FileDelete($shortcutPath) EndFunc RunFromExplorer("C:\Windows\notepad.exe") sleep(1000) RunFromExplorer("C:\Program Files (x86)\Windows NT\Accessories\wordpad.exe") Exit Works only first time. then you need to close/reopen session ... http://discuss.pcmag.com/forums/thread/1004433200.aspx
  19. indeed, this solution works ! nice, really, as I think it will be more reliable in the future than a code injection into explorer.exe anyway, once I've done, I can't create anymore a new shortcut with ctrl+alt+t I guess all hotkeys for shortcuts are saved somewhere in the registry, so we should delete this also each time we use this snippet
  20. hmm this doesn't work. it start it without any parent process. Func startServer() ConsoleWrite("startServer"&@CR) $serverStart = "D:\BB_Server.lnk" ShellExecute($serverStart) EndFunc HotKeySet("Ctrl+Alt+Shift+F12", "startServer") Send("Ctrl+Alt+Shift+F12") About RunFromProcess: It seems it use traditionnal code injection with kernel32.dll http://waitfordebug.wordpress.com/2012/02/07/dll-injection-in-python/ But this not 'traditionnal' at for me lol !! I'm trying with both autoit and python but can't find out how to encode shellcode for a simple winexec command.
  21. wow nice idea ! Will try that !!
  22. Still no solution. I've came accroos this which may be a good direction to go : http://forum.sysinternals.com/tip-run-process-in-system-account-scexe_topic16714.html If anyone have any input ...
  23. yep but still doesn't know how to do it. Lot of stuff on msdn also but nothing about this I can find.
  24. Ok no problem and nothing secret there, was not talking about it to not bother you. I must say it's the first time I see such behavior also, and previous version of this software didn't needed this. It is server.exe, part of Autodesk Backburner. This server.exe start 3dsmax.exe and if server.exe isn't a child process of main explorer.exe 3dsmax.exe has some difficulties to create some files while starting (I guess it ask its parent explorer.exe and don't find it ?). This is for 3dsmax 2014, and 3dsmax2012 (with backburner2012) never had such problems. The fact is that if I start server.exe with RunFromProcess-x64, all runs fine. The command that works : $RFPpath = "D:RunFromProcess-x64.exe" $startPath = "C:Program Files (x86)AutodeskBackburnerserver.exe" ShellExecute($RFPpath, " nomsg explorer.exe "&$startPath, "C:Program Files (x86)AutodeskBackburner") which runs : D:RunFromProcess-x64.exe nomsg explorer.exe C:Program Files (x86)AutodeskBackburnerserver.exe You know it all
  25. I've tried this but it make myfile.exe child of an explorer.exe, child of svchost.exe, child of services.exe, child of wininit.exe Not a child of the user main explorer.exe and doesn't work
×
×
  • Create New...