Jump to content

lowrider2025

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by lowrider2025

  1. Thanks for the help Danyfirex but you changed your reply afterwards...I was replying to your initial answer. The first suggestion of your modified reply works: adding the ampersand. Second one does not. Second one works too ! Edit: must have made a typo somewhere first time around...sorry 😓
  2. Sorry didn't help...no output (but dit not echo back the command 🙂).
  3. Local $iPID = Run(@ComSpec & ' /c powershell -Command "' & '{Get-NetAdapter | Where-Object InterfaceType -eq 71}' & '"','',@SW_HIDE,6) ProcessWaitClose($iPID) ConsoleWrite(StdoutRead($iPID) & @CRLF) Returns "Get-NetAdapter | Where-Object InterfaceType -eq 71" Is there a way to get the output of the command instead of just the command itself that is being echoed back ? Thanks
  4. I know, just too lazy to type the whole procedure OK, so killing explorer it is then...
  5. Could 2 or 3 be run with CreateProcessAsUser ?
  6. I have found several techniques to rebuild icon cache however almost all of them cannot interact with desktop from user that is logged in. I have some SCCM like software that installs software under system account. 1) kill explorer + start explorer > works for all user sessions 2) ie4uinit -cleariconcache > no impact on logged in user desktop session 3) SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL) > no impact on logged in user desktop session Is there a less abrupt way than option 1 to rebuild icon cache for all current desktop sessions ?
  7. Does someone know what happens if programs from run in hklm run after program in hkcu (program that needs Login window on top). Would this interfere with the on top setting ? Or does is the WinSetOnTop absolute ? Am I exact in thinking: ProcessWait(process.exe) WinSetOnTop: 10ms process.exe takes 500ms to display it's splash screen so this happens after SetOnTop from 1st program. Will this have process.exe's window in front of the window of the 1st program ? Or let 1st program sleep for 10 seconds and then WinActivate("Login") and WinSetOnTop("Login","",1) ?
  8. Sorry edited my 1st post and yes also tried WinSetOnTop...
  9. Does the windows startup mechanism have a fixed timeout for programs or can it not see other processes while it has been launched in the startup folder ? I want a certain program to have it's window on top. But this doesn't work. What I do: Run(program,programdir) ;this needs program needs it window on top "Login"(child window of main program) ProcessWait(other program.exe,5) WinActivate("Login") (also tried : WinSetOnTop("Login","",1) So both programs open but other program stays on top. Should be simple to do...but in my case not so
  10. I am able to pin a popup menu that we use company wide to the taskbar but sometimes the pinned item just vanishes (always the same users, I know you have 'em too ;-) ). I am creating a restore menu-program that repins the menu. I am able to repin the menu, but I want it back on the left side next to the start menu (windows 7 - 32-bits). Is it possible to get the coordinates of the last added item to the taskbar? Or can you search all elements of MSTaskListWClass and do a search based on caption and then simulate a mouse down to drag the pinned item next to the start menu ? Thanks
  11. Wow, all those replies :-) . For the time being I created a new csv file and then filewriteline added the values separated by commas and then converted it back to a 'real' excel file. So the array does contain elements and I am able to fill them in a csv file. But if I could get the _Excel_RangeWrite thing going, it would be neater.
  12. Thx kcvinu for replying. Did the changes you suggested but file is still empty...
  13. Hi, I'm trying to compare 2 excel files. One has pc's with identification numbers being replaced by new pc's the other file contains user names that use the old pc's being replaced. Trying to compare the files and fill in the users that will get the new pc in first file by inserting the users in an empty column (D). After I run the script the file(delivery.xls) is empty... Long time user of autoit. First time with excel udf. Autoit version: 3.3.12.0 Excel 2013 Windows 7 #include <Excel.au3> ; Create application object Local $oExcel = _Excel_Open(False,False) If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = @ScriptDir & "\delivery.xls" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook,False,False) Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:C"),1) Local $sWorkbookUsers = @ScriptDir & "\users.xls" Local $oWorkbookUsers = _Excel_BookOpen($oExcel, $sWorkbookUsers,True,False) Local $aUsers = _Excel_RangeRead($oWorkbookUsers, Default, $oWorkbookUsers.ActiveSheet.Usedrange.Columns("A:E"),1) _Excel_BookClose($oWorkbookUsers,False) If $aResult<>Null Then For $i=0 to UBound($aResult)-1 For $j=0 to UBound($aUsers)-1 If $aResult[$i][2]==$aUsers[$j][0] Then _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet,$aUsers[$j][2],"D"&$i+1) Else EndIf Next Next Else MsgBox(0,"test","no array",3) EndIf _Excel_BookSave($oWorkbook) _Excel_Close($oExcel)
  14. I solved my own problem. I got the vbs script from a colleague. He doesn't have any problems apparently. But when I translate it to autoit I have to explicitly make a ADODB.Connection object which I can use till I close it and so I can make multiple recordsets.
  15. Thx for the reply. But using the UDF, you would have to use a complete different syntax which I do not fully master at the moment. Is there no way to do it the way I'm doing it now ?
  16. Hi, I'm having some trouble with a script that needs to do work on multiple tables. In vbs you can close the recordset but it will not be destroyed until you do "set rs = nothing" when you do rs.close in autoit the object is gone apparently because I get an error when I try to open a new sql query with the existing recordset object. If I remove the rs.close it doesn't protest for not closing the recordset, but the following sql query generates an error. Any ideas how you can do multiple sql queries with 1 recordset object ? sample code: $sServerIP = "ip.ip.ip.ip" $sUsername = "user" $sPassword = "password" $sDatabase = "database" $sConnectionString = "DRIVER=" & $sDriver & ";Server=" & $sServerIP & ";Uid=" & $sUsername & ";Password=" & $sPassword & ";Database=" & $sDatabase & ";Option=" & $iOption $sSQL = "SELECT * FROM logins ORDER BY id desc limit 1" $oRS = ObjCreate("ADODB.RecordSet") $oRS.CursorType = $iAdOpenStatic $oRS.LockType = $iAdLockOptimistic $oRS.ActiveConnection = $sConnectionString $oRS.Open($sSQL) $oRS.Addnew $oRS("alias") = @UserName $oRS("hostname") = @ComputerName $oRS("ip") = $Nic.IPAddress(0) $oRS("date") = _NowDate() $oRS("time") = _NowTime() $oRS("log_in_out") = "login" $oRS.Update $oRS.Close
  17. No, I guess that's why it doesn't work. Problem is I have to deploy this vbs script to 50 or so machines. And I want it to run off a network drive. I guess I'll try and convert the vbs script to autoit(exe-file) and write an autoit script that writes a new entry in the registry HKLM\Software\Microsoft\Windows\CurrentVersion\Run . Or would someone suggest something faster and easier ? I'm working in a netware environment.
  18. when I use a MsgBox to show the path it shows P:\KAV\login_mysql.vbs . The correct path. Example: drive P refers to \\servername\appl so: wscript.exe P:\KAV\login_mysql.vbs Why would this not work ? Full Story: All this in P:\KAV. autoit script to run as Admin. vbs script in same folder. => error : can not find script file "P:\KAV\login_mysql.vbs"
  19. Hi, Local $sDbUser = @UserName RunAs("Administrator", @ComputerName, "password", 0, @WindowsDir & '\System32\wscript.exe "' & @WorkingDir & '\login_mysql.vbs" ' & '"' & $sDbUser & '"' , "",@SW_HIDE) Could anyone tell me why I get "can not find script file" when I put the autoit executable and the vbs file on a mounted network drive while putting it on a local drive does work ? Thanks Tim
  20. I know it doesn't seem very logical, but it still is faster and much faster really.
  21. It's going faster now.I'm using mousemove,mousedown & mouseup.
  22. I'm afraid ControlClick is not an option. I thought about it but then realised it only works for controls. The mouse is clicking on a flash-movie so not buttons from another program or something. But thanks for thinking with me.
  23. Thanks. And thanks everyone for the replies. But it doesn't seem to speed up all that much :s. Added these: Opt('MouseClickDelay',0) Opt('MouseClickDownDelay',0) Opt('MouseClickDragDelay',0)
  24. Hi everyone, I made a program that clicks on screen coordinates. I enter letters on buttons (the buttons correspond to coordinates on the screen). I enter a word.It finds the letters.Makes the right order of coordinates and then clicks all of the coordinates. But the problem is that it isn't fast enough. It takes 500 milliseconds at least for each click. MouseClick("left",StringLeft($arClicks[$k],4),StringRight($arClicks[$k],3),1) => This is the crucial line of code. The speed of mouseclick is at 1 so it doesn't go any faster than this. When I put it to 0 it doesn't work anymore. Can someone help me to speed things up. Thanks, Tim #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #Include <GuiEdit.au3> #include <GuiButton.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $btn1, $btn2, $btn3, $btn4, $btn5, $btn6, $btn7, $btn8 Local $btnSend, $btnDefaults, $btnClick Local $lblWoord, $txtWoord, $pct1 Local $msg, $frmWordClicker Local $Val1, $Val2, $Val3, $Val4, $Val5, $Val6, $Val7, $Val8 Local $sWoord, $Tekst, $i, $j, $k, $Letter Local $arCoords[8], $arLetters[8] $arCoords[0] = "1180,374" $arCoords[1] = "1263,374" $arCoords[2] = "1345,374" $arCoords[3] = "1180,456" $arCoords[4] = "1345,456" $arCoords[5] = "1180,538" $arCoords[6] = "1263,538" $arCoords[7] = "1345,538" #Region ### START Koda GUI section ### Form= $frmWordClicker = GUICreate("Word Clicker", 225, 312, 204, 114) $btn1 = GUICtrlCreateButton("1", 8, 8, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn2 = GUICtrlCreateButton("2", 80, 8, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn3 = GUICtrlCreateButton("3", 152, 8, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn4 = GUICtrlCreateButton("4", 8, 80, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn5 = GUICtrlCreateButton("6", 152, 80, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn6 = GUICtrlCreateButton("7", 8, 152, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn7 = GUICtrlCreateButton("8", 80, 152, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $btn8 = GUICtrlCreateButton("9", 152, 152, 65, 65, 0) GUICtrlSetFont(-1, 19, 400, 0, "MS Sans Serif") $pct1 = GUICtrlCreatePic("C:\Documents and Settings\xxx\Bureaublad\xxxx.jpg", 80, 80, 65, 65, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $lblWoord = GUICtrlCreateLabel("Woord:", 8, 232, 39, 17) $txtWoord = GUICtrlCreateInput("", 48, 229, 169, 25) $btnSend = GUICtrlCreateButton("send", 8, 272, 73, 33, 0) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $btnDefaults = GUICtrlCreateButton("reset", 100, 272, 73, 33, 0) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $btnClick = GUICtrlCreateButton("click", 180, 272, 45, 33, 0) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btnClick For $k = 0 to UBound($arClicks)-1 Step 1 MouseClick("left",StringLeft($arClicks[$k],4),StringRight($arClicks[$k],3),1) Next Case $msg = $btnSend $sWoord = _GUICtrlEdit_GetText($txtWoord) Global $arClicks[StringLen($sWoord)] For $i = 1 to StringLen($sWoord) Step 1 $Letter = StringMid($sWoord,$i,1) For $j = 0 to UBound($arLetters)-1 Step 1 If $Letter==StringLeft($arLetters[$j],1) Then $arClicks[$i-1]=StringLeft($arCoords[$j],4) & "," & StringRight($arCoords[$j],3) _ArrayDelete($arLetters,$j) _ArrayDelete($arCoords,$j) ExitLoop EndIf Next Next Case $msg = $btn1 $Val1 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn1, $Val1) $Val2 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn2, $Val2) $Val3 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn3, $Val3) $Val4 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn4, $Val4) $Val5 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn5, $Val5) $Val6 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn6, $Val6) $Val7 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn7, $Val7) $Val8 = InputBox("Geef waarde voor 1","Geef een letter in","","",100,50) _GUICtrlEdit_SetText($btn8, $Val8) $arLetters[0]=$Val1 $arLetters[1]=$Val2 $arLetters[2]=$Val3 $arLetters[3]=$Val4 $arLetters[4]=$Val5 $arLetters[5]=$Val6 $arLetters[6]=$Val7 $arLetters[7]=$Val8 ControlFocus("Word Clicker","",13) Case $msg = $btnDefaults _GUICtrlEdit_SetText($btn1, "1") _GUICtrlEdit_SetText($btn2, "2") _GUICtrlEdit_SetText($btn3, "3") _GUICtrlEdit_SetText($btn4, "4") _GUICtrlEdit_SetText($btn5, "6") _GUICtrlEdit_SetText($btn6, "7") _GUICtrlEdit_SetText($btn7, "8") _GUICtrlEdit_SetText($btn8, "9") _GUICtrlEdit_SetText($txtWoord,"") ControlFocus("Word Clicker","",13) EndSelect WEnd GUIDelete() Exit EndFunc ;==>_Main
×
×
  • Create New...