Jump to content

larksp

Active Members
  • Posts

    50
  • Joined

  • Last visited

larksp's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. thank you i have the console read out ok now Searching for updates... 1> Skype for Windows desktop 7.3 (KB2876229) 2> August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 3> Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.813.0) Creating collection of updates to download: !1> Removing: Skype for Windows desktop 7.3 (KB2876229) 2> adding: August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) !3> Removing: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.813.0) now to check it actually download and seeing it not install the hideup
  2. ok thanks i will have a play now... i think im starting to understand to why using = true or false then then checking for true of false before then adding
  3. The main reason i went with If StringInStr is so the name dont have to 100% match $Hideup[0] = "Skype for Windows" Removing: Skype for Windows desktop 7.3 (KB2876229) as next month it might be skype 7.4 for example the idea i was going for was.. as it search for updates if that update was skype (or in $hideup (List)) it would skip it and move onto the next update there for not adding it to the download list <--- but i am doing the loop wrong i guess not fully understanding what it is actually doing to what i want it to do the "" if in list "" i did not know that was a thing as cant F1 the word List so something i will have to look up on for details could be a usefull thing
  4. any suggestions ? the only way i can work it out is doing it by if StringInStr( $update.Title, $Hideup[0]) Then ConsoleWrite('!' & $I + 1 & "> Removing: " & $update.Title & @CR) ; only check for 1 item ElseIf StringInStr( $update.Title, $Hideup[1]) Then ConsoleWrite('!' & $I + 1 & "> Removing: " & $update.Title & @CR) ; only check for 1 item Else endif but then if i had an array of 20... e.g $hideup[20] that is alot of elseif
  5. hopefully i got that right in the title so it loops through each of the updates in my case 4.. i dont want skype but have tried to add an option to stop more than just skype the loop is not right and unsure how to get right This is just some of the testing code as does not actual need download the updates while testing "Definition Update" --> Only using as a test for array. to make sure it works and it does not lol Local $Hideup[2] $Hideup[0] = "Skype for Windows" $Hideup[1] = "Definition Update" $updateSession = ObjCreate("Microsoft.update.Session") $updateSearcher = $updateSession.CreateupdateSearcher() ConsoleWrite("Searching for updates..." & @CRLF) $searchResult = $updateSearcher.Search("IsInstalled=0 and Type='Software' and IsAssigned=0") ; A LIST OF UPDATES For $I = 0 To $searchResult.Updates.Count - 1 $update = $searchResult.Updates.Item($I) ConsoleWrite($I + 1 & "> " & $update.Title & @CR) ;~ if StringInStr( $update.Title, $Hideup[0]) Then ConsoleWrite(@CRLF & 'YIPEE' & @CRLF) ; only check for 1 item Next If $searchResult.Updates.Count = 0 Then ConsoleWrite("There are no applicable updates.") Exit EndIf ConsoleWrite(@CRLF & "Creating collection of updates to download:" & @CR) $updatesToDownload = ObjCreate("Microsoft.update.UpdateColl") For $I = 0 To $searchResult.Updates.Count - 1 $update = $searchResult.Updates.Item($I) ;~ **************************************** ;~ **************************************** ;~ **************************************** For $j = 0 To UBound($Hideup) -1 If StringInStr($update.Title, $Hideup[$j]) Then ConsoleWrite('!' & $I + 1 & "> Removing: " & $update.Title & @CR) ExitLoop Else ConsoleWrite($I + 1 & "> adding: " & $update.Title & @CR) $updatesToDownload.Add($update) EndIf Next ;~ **************************************** ;~ **************************************** ;~ **************************************** Next so 1 worked and then is start getting doubles ups the results i get from console Searching for updates... 1> Skype for Windows desktop 7.3 (KB2876229) 2> Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) 3> August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 4> Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0) Creating collection of updates to download: !1> Removing: Skype for Windows desktop 7.3 (KB2876229) 2> adding: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) !2> Removing: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) 3> adding: August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 3> adding: August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 4> adding: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0) !4> Removing: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0)
  6. there is an extra = on the end of the code that brings up an error encase any one cared GUICtrlSetState($Bar, $GUI_HIDE)=
  7. thank you for replying and explaining
  8. thank you for the reply... sorry i only just logged in to notice no issue with admin rights..... i run from a USB plugged into the computer.. i will have to wait until Tuesday + Wed to test that.. no com ports at home to test i guess that also needs a restart as its registry to work... where the control clicking horrible as it is does not.. but i will still play test and see only a restart lol
  9. I was wondering why i have to add "+1 -1 " ConsoleWrite (_GUICtrlListView_GetItemTextString($idListview,$no +1 -1) & @CRLF & $no & @CRLF ) to make it work why it cant just take as you can see the $no is a Number ConsoleWrite (_GUICtrlListView_GetItemTextString($idListview,$no) & @CRLF & $no & @CRLF ) does not work code copied from a post by ("InunoTaishou") i was just playing around learning try to learn how to right click on the list view and copy the information to clipboard or to save to a file the selected test NEXT practice will be How to do multi selected lines or say tick boxes and the ones with the ticks in get copied #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <GuiListView.au3> Global $no Global Const $VALUE_DEPARTMENT = 0 Global Const $VALUE_EMAIL = 1 Global Const $VALUE_NAME = 2 Global Const $VALUE_PHONE = 3 Global $title = "E-Mail address lookup" Global $result[][4] = [["Dept1", "User1@mail.com", "User1", "555-555-5555"], ["Dept2", "User2@mail.com", "User2", "555-555-5555"], ["Dept3", "User3@mail.com", "User3", "555-555-5555"]] Global $ControlID = GUICreate($title, 550, 160) Global $idListview = GUICtrlCreateListView("Deparment|E-Mail Address|Name|Telephone Number", 10, 10, 530, 150) ;~ Global $get_email Global $rset = UBound($result) - 1 For $count = 0 To $rset GUICtrlCreateListViewItem($result[$count][0] & "|" & $result[$count][1] & "|" & $result[$count][2] & "|" & $result[$count][3], $idListview) Next Global $context = GUICtrlCreateContextMenu($idListview) Global $menuitem = GUICtrlCreateMenuItem("Copy email address", $context) ;~ Global $copytext GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case -3 Exit Case $menuitem $no = _GUICtrlListView_GetSelectedIndices($idListview) _ShowText(_GUICtrlListView_GetSelectedIndices($idListview)) ConsoleWrite (_GUICtrlListView_GetItemTextString($idListview,$no +1 -1) & @CRLF & $no & @CRLF ) ConsoleWrite (_GUICtrlListView_GetItemTextString($idListview,$no) & @CRLF & $no & @CRLF ) EndSwitch WEnd Func _ShowText($vSelected) Local $sEmails = "" Local $sNames = "" If (IsArray($vSelected)) Then ;~ ; In case multiple items are selected For $i = 0 to UBound($vSelected) -1 $sNames &= $result[$vSelected][$VALUE_NAME] & ", " $sEmails &= $result[$vSelected][$VALUE_EMAIL] & ", " Next $sEmails = StringTrimRight($sEmails, 2) $sNames = StringTrimRight($sNames, 2) ConsoleWrite($sNames & " put in clipboard" & @CRLF) ClipPut($sEmails) Else ;~ msgbox (0,0,0) ConsoleWrite($result[$vSelected][$VALUE_NAME] & " put in clipboard" & @CRLF) ClipPut($result[$vSelected][$VALUE_EMAIL]) EndIf EndFunc ;==>_ShowText
  10. Hi i did ask a Question like this few months back and only got bit help with Reg way and did not like that and ended up going with controlclick commands and using Run('rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID acpi\pnp0501\1') Run('rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID acpi\pnp0501\2') some times after a reinstall of windows the ports reassignment is wrong... the port i want as 1 is now port 2 and what i want as port 2 is port 1 Port1 should be rs232 and i think com2 might be a dvi or something else on the acer pc either way i wanted the rs232 on 1 So i have to Switch port 1 To port 3 (Cant switch To 2 as there is already a 2) port 2 To port 1 port 3 To port 1 #RequireAdmin #Include <Array.au3> #include <CommMG.au3> ocal $sportSetError $aListPortNames = _ComGetPortNames(0) _ArrayDisplay($aListPortNames) ; list available port _commswitch(1) ;go to COM1 _CommSetPort("2",$sportSetError,9600, 8, 0, 1, 0, 0, 0);channel 1 is COM2 $chan = IscomConnected("COM2") if $chan <> 0 then MsgBox(0,'COM2', "Is connected on channel " & $chan) _CommCloseport("2") Run('rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID acpi\pnp0501\1') The msgbox Says COM2 is on channel 1 but the ports have not switched
  11. this might help .. that was after quick search..
  12. i am only trying it local run straight from the desktop on windows 7 no luck on a few windows 7
  13. yes i did.. this why im using msgbox instead of console as you cant read console while running in admin
  14. i thought this would been done before but i cant find the answer when i search defrag seems to work on using vb code to defrag with wmi but i get error 11 with autoit witch means unknown error $WMIService = ObjGet("winmgmts:\\.\root\cimv2") $WMIVolumes = $WMIService.ExecQuery("Select * from Win32_Volume WHERE name = 'C:\\'") If IsObj($WMIVolumes) Then For $Volume In $WMIVolumes ;~ $Test = $Volume.DefragAnalysis ; just testing $errR = $Volume.Defrag() Next If $errR = 0 Then MsgBox(0, 'Defrag', "Drive " & $Volume.Name & " Successfully Defragged.") Else MsgBox(0, 'Defrag', "Error = " & $errR & " Defrag Failed.") EndIf EndIf ;~ MsgBox(0, 'Moo', "Drive " & $test) i have tried with Admin.. this is why im using message box rather than console for the error next would be check disk with back sectors but 1 thing at a time (Defrag) i do know there is a cmd command for this . have also done this by Open gui window then using control clicks so i can see a progress as well but i like to try different ways to learn..
  15. Table Name Version Version wktv1401 Letters are random but far as i know always 4 as in "wktv" i used $D = StringRegExpReplace($Dbdata, '\D', '') return $D what gives me 1401.. what works fine just wondered was that the best way could have used stringtrimleft($Dbdata,4) but who knows if it stays 4 letters or not 1401 is year 14 month 01 also when using objcreate or wmi.. You get $var.'Name' .description or in this case .fields or .value what is that called so if i wanted to google ObjCreate("ADODB.Connection" to find all of the .WhatEvers i can use i dont need them but dont know what they are called or referred to by name
×
×
  • Create New...