Sign in to follow this  
Followers 0
swstrau118

Remote Computer Command Help!

10 posts in this topic

I am trying to create a script that can Clear the cache/ close IE/ run a batch file on the remote computer. Here is the Remote Code that I have used in the past - I have got this from someone a long time ago - This runs really well but How can I insert more commands at the bottom (Clear cahce)? Also could someone walk me through part of the code, especially all the Global Const code.

Thanks!

Global Const $gui_event_close = -3
Global Const $gui_event_minimize = -4
Global Const $gui_event_restore = -5
Global Const $gui_event_maximize = -6
Global Const $gui_event_primarydown = -7
Global Const $gui_event_primaryup = -8
Global Const $gui_event_secondarydown = -9
Global Const $gui_event_secondaryup = -10
Global Const $gui_event_mousemove = -11
Global Const $gui_event_resized = -12
Global Const $gui_event_dropped = -13
Global Const $gui_rundefmsg = "GUI_RUNDEFMSG"
Global Const $gui_avistop = 0
Global Const $gui_avistart = 1
Global Const $gui_aviclose = 2
Global Const $gui_checked = 1
Global Const $gui_indeterminate = 2
Global Const $gui_unchecked = 4
Global Const $gui_dropaccepted = 8
Global Const $gui_nodropaccepted = 4096
Global Const $gui_acceptfiles = $gui_dropaccepted
Global Const $gui_show = 16
Global Const $gui_hide = 32
Global Const $gui_enable = 64
Global Const $gui_disable = 128
Global Const $gui_focus = 256
Global Const $gui_nofocus = 8192
Global Const $gui_defbutton = 512
Global Const $gui_expand = 1024
Global Const $gui_ontop = 2048
Global Const $gui_fontitalic = 2
Global Const $gui_fontunder = 4
Global Const $gui_fontstrike = 8
Global Const $gui_dockauto = 1
Global Const $gui_dockleft = 2
Global Const $gui_dockright = 4
Global Const $gui_dockhcenter = 8
Global Const $gui_docktop = 32
Global Const $gui_dockbottom = 64
Global Const $gui_dockvcenter = 128
Global Const $gui_dockwidth = 256
Global Const $gui_dockheight = 512
Global Const $gui_docksize = 768
Global Const $gui_dockmenubar = 544
Global Const $gui_dockstatebar = 576
Global Const $gui_dockall = 802
Global Const $gui_dockborders = 102
Global Const $gui_gr_close = 1
Global Const $gui_gr_line = 2
Global Const $gui_gr_bezier = 4
Global Const $gui_gr_move = 6
Global Const $gui_gr_color = 8
Global Const $gui_gr_rect = 10
Global Const $gui_gr_ellipse = 12
Global Const $gui_gr_pie = 14
Global Const $gui_gr_dot = 16
Global Const $gui_gr_pixel = 18
Global Const $gui_gr_hint = 20
Global Const $gui_gr_refresh = 22
Global Const $gui_gr_pensize = 24
Global Const $gui_gr_nobkcolor = -2
Global Const $gui_bkcolor_default = -1
Global Const $gui_bkcolor_transparent = -2
Global Const $gui_bkcolor_lv_alternate = -33554432
Global Const $gui_ws_ex_parentdrag = 1048576
Global Const $ws_tiled = 0
Global Const $ws_overlapped = 0
Global Const $ws_maximizebox = 65536
Global Const $ws_minimizebox = 131072
Global Const $ws_tabstop = 65536
Global Const $ws_group = 131072
Global Const $ws_sizebox = 262144
Global Const $ws_thickframe = 262144
Global Const $ws_sysmenu = 524288
Global Const $ws_hscroll = 1048576
Global Const $ws_vscroll = 2097152
Global Const $ws_dlgframe = 4194304
Global Const $ws_border = 8388608
Global Const $ws_caption = 12582912
Global Const $ws_overlappedwindow = 13565952
Global Const $ws_tiledwindow = 13565952
Global Const $ws_maximize = 16777216
Global Const $ws_clipchildren = 33554432
Global Const $ws_clipsiblings = 67108864
Global Const $ws_disabled = 134217728
Global Const $ws_visible = 268435456
Global Const $ws_minimize = 536870912
Global Const $ws_child = 1073741824
Global Const $ws_popup = -2147483648
Global Const $ws_popupwindow = -2138570752
Global Const $ds_modalframe = 128
Global Const $ds_setforeground = 512
Global Const $ds_contexthelp = 8192
Global Const $ws_ex_acceptfiles = 16
Global Const $ws_ex_mdichild = 64
Global Const $ws_ex_appwindow = 262144
Global Const $ws_ex_composited = 33554432
Global Const $ws_ex_clientedge = 512
Global Const $ws_ex_contexthelp = 1024
Global Const $ws_ex_dlgmodalframe = 1
Global Const $ws_ex_leftscrollbar = 16384
Global Const $ws_ex_overlappedwindow = 768
Global Const $ws_ex_right = 4096
Global Const $ws_ex_staticedge = 131072
Global Const $ws_ex_toolwindow = 128
Global Const $ws_ex_topmost = 8
Global Const $ws_ex_transparent = 32
Global Const $ws_ex_windowedge = 256
Global Const $ws_ex_layered = 524288
Global Const $ws_ex_controlparent = 65536
Global Const $ws_ex_layoutrtl = 4194304
Global Const $ws_ex_rtlreading = 8192
Global Const $wm_gettextlength = 14
Global Const $wm_gettext = 13
Global Const $wm_size = 5
Global Const $wm_sizing = 532
Global Const $wm_user = 1024
Global Const $wm_create = 1
Global Const $wm_destroy = 2
Global Const $wm_move = 3
Global Const $wm_activate = 6
Global Const $wm_setfocus = 7
Global Const $wm_killfocus = 8
Global Const $wm_enable = 10
Global Const $wm_setredraw = 11
Global Const $wm_settext = 12
Global Const $wm_paint = 15
Global Const $wm_close = 16
Global Const $wm_quit = 18
Global Const $wm_erasebkgnd = 20
Global Const $wm_syscolorchange = 21
Global Const $wm_showwindow = 24
Global Const $wm_wininichange = 26
Global Const $wm_devmodechange = 27
Global Const $wm_activateapp = 28
Global Const $wm_fontchange = 29
Global Const $wm_timechange = 30
Global Const $wm_cancelmode = 31
Global Const $wm_setcursor = 32
Global Const $wm_mouseactivate = 33
Global Const $wm_childactivate = 34
Global Const $wm_queuesync = 35
Global Const $wm_getminmaxinfo = 36
Global Const $wm_painticon = 38
Global Const $wm_iconerasebkgnd = 39
Global Const $wm_nextdlgctl = 40
Global Const $wm_spoolerstatus = 42
Global Const $wm_drawitem = 43
Global Const $wm_measureitem = 44
Global Const $wm_deleteitem = 45
Global Const $wm_vkeytoitem = 46
Global Const $wm_chartoitem = 47
Global Const $wm_setfont = 48
Global Const $wm_getfont = 49
Global Const $wm_sethotkey = 50
Global Const $wm_gethotkey = 51
Global Const $wm_querydragicon = 55
Global Const $wm_compareitem = 57
Global Const $wm_getobject = 61
Global Const $wm_compacting = 65
Global Const $wm_commnotify = 68
Global Const $wm_windowposchanging = 70
Global Const $wm_windowposchanged = 71
Global Const $wm_power = 72
Global Const $wm_notify = 78
Global Const $wm_copydata = 74
Global Const $wm_canceljournal = 75
Global Const $wm_inputlangchangerequest = 80
Global Const $wm_inputlangchange = 81
Global Const $wm_tcard = 82
Global Const $wm_help = 83
Global Const $wm_userchanged = 84
Global Const $wm_notifyformat = 85
Global Const $wm_cut = 768
Global Const $wm_copy = 769
Global Const $wm_paste = 770
Global Const $wm_clear = 771
Global Const $wm_undo = 772
Global Const $wm_contextmenu = 123
Global Const $wm_stylechanging = 124
Global Const $wm_stylechanged = 125
Global Const $wm_displaychange = 126
Global Const $wm_geticon = 127
Global Const $wm_seticon = 128
Global Const $wm_nccreate = 129
Global Const $wm_ncdestroy = 130
Global Const $wm_nccalcsize = 131
Global Const $wm_nchittest = 132
Global Const $wm_ncpaint = 133
Global Const $wm_ncactivate = 134
Global Const $wm_getdlgcode = 135
Global Const $wm_syncpaint = 136
Global Const $wm_ncmousemove = 160
Global Const $wm_nclbuttondown = 161
Global Const $wm_nclbuttonup = 162
Global Const $wm_nclbuttondblclk = 163
Global Const $wm_ncrbuttondown = 164
Global Const $wm_ncrbuttonup = 165
Global Const $wm_ncrbuttondblclk = 166
Global Const $wm_ncmbuttondown = 167
Global Const $wm_ncmbuttonup = 168
Global Const $wm_ncmbuttondblclk = 169
Global Const $wm_keydown = 256
Global Const $wm_keyup = 257
Global Const $wm_char = 258
Global Const $wm_deadchar = 259
Global Const $wm_syskeydown = 260
Global Const $wm_syskeyup = 261
Global Const $wm_syschar = 262
Global Const $wm_sysdeadchar = 263
Global Const $wm_initdialog = 272
Global Const $wm_command = 273
Global Const $wm_syscommand = 274
Global Const $wm_timer = 275
Global Const $wm_hscroll = 276
Global Const $wm_vscroll = 277
Global Const $wm_initmenu = 278
Global Const $wm_initmenupopup = 279
Global Const $wm_menuselect = 287
Global Const $wm_menuchar = 288
Global Const $wm_enteridle = 289
Global Const $wm_menurbuttonup = 290
Global Const $wm_menudrag = 291
Global Const $wm_menugetobject = 292
Global Const $wm_uninitmenupopup = 293
Global Const $wm_menucommand = 294
Global Const $wm_changeuistate = 295
Global Const $wm_updateuistate = 296
Global Const $wm_queryuistate = 297
Global Const $wm_ctlcolormsgbox = 306
Global Const $wm_ctlcoloredit = 307
Global Const $wm_ctlcolorlistbox = 308
Global Const $wm_ctlcolorbtn = 309
Global Const $wm_ctlcolordlg = 310
Global Const $wm_ctlcolorscrollbar = 311
Global Const $wm_ctlcolorstatic = 312
Global Const $wm_ctlcolor = 25
Global Const $mn_gethmenu = 481
Global Const $nm_first = 0
Global Const $nm_outofmemory = $nm_first - 1
Global Const $nm_click = $nm_first - 2
Global Const $nm_dblclk = $nm_first - 3
Global Const $nm_return = $nm_first - 4
Global Const $nm_rclick = $nm_first - 5
Global Const $nm_rdblclk = $nm_first - 6
Global Const $nm_setfocus = $nm_first - 7
Global Const $nm_killfocus = $nm_first - 8
Global Const $nm_customdraw = $nm_first - 12
Global Const $nm_hover = $nm_first - 13
Global Const $nm_nchittest = $nm_first - 14
Global Const $nm_keydown = $nm_first - 15
Global Const $nm_releasedcapture = $nm_first - 16
Global Const $nm_setcursor = $nm_first - 17
Global Const $nm_char = $nm_first - 18
Global Const $nm_tooltipscreated = $nm_first - 19
Global Const $nm_ldown = $nm_first - 20
Global Const $nm_rdown = $nm_first - 21
Global Const $nm_themechanged = $nm_first - 22
Global Const $wm_mousemove = 512
Global Const $wm_lbuttondown = 513
Global Const $wm_lbuttonup = 514
Global Const $wm_lbuttondblclk = 515
Global Const $wm_rbuttondown = 516
Global Const $wm_rbuttonup = 517
Global Const $wm_rbuttondblck = 518
Global Const $wm_mbuttondown = 519
Global Const $wm_mbuttonup = 520
Global Const $wm_mbuttondblck = 521
Global Const $wm_mousewheel = 522
Global Const $wm_xbuttondown = 523
Global Const $wm_xbuttonup = 524
Global Const $wm_xbuttondblclk = 525
Global Const $wm_mousehwheel = 526
Global Const $ps_solid = 0
Global Const $ps_dash = 1
Global Const $ps_dot = 2
Global Const $ps_dashdot = 3
Global Const $ps_dashdotdot = 4
Global Const $ps_null = 5
Global Const $ps_insideframe = 6
Global Const $lwa_alpha = 2
Global Const $lwa_colorkey = 1
Global Const $rgn_and = 1
Global Const $rgn_or = 2
Global Const $rgn_xor = 3
Global Const $rgn_diff = 4
Global Const $rgn_copy = 5
Global Const $errorregion = 0
Global Const $nullregion = 1
Global Const $simpleregion = 2
Global Const $complexregion = 3
Global Const $transparent = 1
Global Const $opaque = 2
Global Const $ccm_first = 8192
Global Const $ccm_getunicodeformat = ($ccm_first + 6)
Global Const $ccm_setunicodeformat = ($ccm_first + 5)
Global Const $ccm_setbkcolor = $ccm_first + 1
Global Const $ccm_setcolorscheme = $ccm_first + 2
Global Const $ccm_getcolorscheme = $ccm_first + 3
Global Const $ccm_getdroptarget = $ccm_first + 4
Global Const $ccm_setwindowtheme = $ccm_first + 11
Global Const $ga_parent = 1
Global Const $ga_root = 2
Global Const $ga_rootowner = 3
Global Const $sm_cxscreen = 0
Global Const $sm_cyscreen = 1
Global Const $sm_cxvscroll = 2
Global Const $sm_cyhscroll = 3
Global Const $sm_cycaption = 4
Global Const $sm_cxborder = 5
Global Const $sm_cyborder = 6
Global Const $sm_cxdlgframe = 7
Global Const $sm_cydlgframe = 8
Global Const $sm_cyvthumb = 9
Global Const $sm_cxhthumb = 10
Global Const $sm_cxicon = 11
Global Const $sm_cyicon = 12
Global Const $sm_cxcursor = 13
Global Const $sm_cycursor = 14
Global Const $sm_cymenu = 15
Global Const $sm_cxfullscreen = 16
Global Const $sm_cyfullscreen = 17
Global Const $sm_cykanjiwindow = 18
Global Const $sm_mousepresent = 19
Global Const $sm_cyvscroll = 20
Global Const $sm_cxhscroll = 21
Global Const $sm_debug = 22
Global Const $sm_swapbutton = 23
Global Const $sm_reserved1 = 24
Global Const $sm_reserved2 = 25
Global Const $sm_reserved3 = 26
Global Const $sm_reserved4 = 27
Global Const $sm_cxmin = 28
Global Const $sm_cymin = 29
Global Const $sm_cxsize = 30
Global Const $sm_cysize = 31
Global Const $sm_cxframe = 32
Global Const $sm_cyframe = 33
Global Const $sm_cxmintrack = 34
Global Const $sm_cymintrack = 35
Global Const $sm_cxdoubleclk = 36
Global Const $sm_cydoubleclk = 37
Global Const $sm_cxiconspacing = 38
Global Const $sm_cyiconspacing = 39
Global Const $sm_menudropalignment = 40
Global Const $sm_penwindows = 41
Global Const $sm_dbcsenabled = 42
Global Const $sm_cmousebuttons = 43
Global Const $sm_secure = 44
Global Const $sm_cxedge = 45
Global Const $sm_cyedge = 46
Global Const $sm_cxminspacing = 47
Global Const $sm_cyminspacing = 48
Global Const $sm_cxsmicon = 49
Global Const $sm_cysmicon = 50
Global Const $sm_cysmcaption = 51
Global Const $sm_cxsmsize = 52
Global Const $sm_cysmsize = 53
Global Const $sm_cxmenusize = 54
Global Const $sm_cymenusize = 55
Global Const $sm_arrange = 56
Global Const $sm_cxminimized = 57
Global Const $sm_cyminimized = 58
Global Const $sm_cxmaxtrack = 59
Global Const $sm_cymaxtrack = 60
Global Const $sm_cxmaximized = 61
Global Const $sm_cymaximized = 62
Global Const $sm_network = 63
Global Const $sm_cleanboot = 67
Global Const $sm_cxdrag = 68
Global Const $sm_cydrag = 69
Global Const $sm_showsounds = 70
Global Const $sm_cxmenucheck = 71
Global Const $sm_cymenucheck = 72
Global Const $sm_slowmachine = 73
Global Const $sm_mideastenabled = 74
Global Const $sm_mousewheelpresent = 75
Global Const $sm_xvirtualscreen = 76
Global Const $sm_yvirtualscreen = 77
Global Const $sm_cxvirtualscreen = 78
Global Const $sm_cyvirtualscreen = 79
Global Const $sm_cmonitors = 80
Global Const $sm_samedisplayformat = 81
Global Const $sm_immenabled = 82
Global Const $sm_cxfocusborder = 83
Global Const $sm_cyfocusborder = 84
Global Const $sm_tabletpc = 86
Global Const $sm_mediacenter = 87
Global Const $sm_starter = 88
Global Const $sm_serverr2 = 89
Global Const $sm_cmetrics = 90
Global Const $sm_remotesession = 4096
Global Const $sm_shuttingdown = 8192
Global Const $sm_remotecontrol = 8193
Global Const $sm_caretblinkingenabled = 8194
Global Const $blackness = 66
Global Const $captureblt = 1073741824
Global Const $dstinvert = 5570569
Global Const $mergecopy = 12583114
Global Const $mergepaint = 12255782
Global Const $nomirrorbitmap = -2147483648
Global Const $notsrccopy = 3342344
Global Const $notsrcerase = 1114278
Global Const $patcopy = 15728673
Global Const $patinvert = 5898313
Global Const $patpaint = 16452105
Global Const $srcand = 8913094
Global Const $srccopy = 13369376
Global Const $srcerase = 4457256
Global Const $srcinvert = 6684742
Global Const $srcpaint = 15597702
Global Const $whiteness = 16711778
Global Const $dt_bottom = 8
Global Const $dt_calcrect = 1024
Global Const $dt_center = 1
Global Const $dt_editcontrol = 8192
Global Const $dt_end_ellipsis = 32768
Global Const $dt_expandtabs = 64
Global Const $dt_externalleading = 512
Global Const $dt_hideprefix = 1048576
Global Const $dt_internal = 4096
Global Const $dt_left = 0
Global Const $dt_modifystring = 65536
Global Const $dt_noclip = 256
Global Const $dt_nofullwidthcharbreak = 524288
Global Const $dt_noprefix = 2048
Global Const $dt_path_ellipsis = 16384
Global Const $dt_prefixonly = 2097152
Global Const $dt_right = 2
Global Const $dt_rtlreading = 131072
Global Const $dt_singleline = 32
Global Const $dt_tabstop = 128
Global Const $dt_top = 0
Global Const $dt_vcenter = 4
Global Const $dt_wordbreak = 16
Global Const $dt_word_ellipsis = 262144
Global Const $rdw_erase = 4
Global Const $rdw_frame = 1024
Global Const $rdw_internalpaint = 2
Global Const $rdw_invalidate = 1
Global Const $rdw_noerase = 32
Global Const $rdw_noframe = 2048
Global Const $rdw_nointernalpaint = 16
Global Const $rdw_validate = 8
Global Const $rdw_erasenow = 512
Global Const $rdw_updatenow = 256
Global Const $rdw_allchildren = 128
Global Const $rdw_nochildren = 64
Global Const $wm_renderformat = 773
Global Const $wm_renderallformats = 774
Global Const $wm_destroyclipboard = 775
Global Const $wm_drawclipboard = 776
Global Const $wm_paintclipboard = 777
Global Const $wm_vscrollclipboard = 778
Global Const $wm_sizeclipboard = 779
Global Const $wm_askcbformatname = 780
Global Const $wm_changecbchain = 781
Global Const $wm_hscrollclipboard = 782
Global Const $hterror = -2
Global Const $httransparent = -1
Global Const $htnowhere = 0
Global Const $htclient = 1
Global Const $htcaption = 2
Global Const $htsysmenu = 3
Global Const $htgrowbox = 4
Global Const $htsize = $htgrowbox
Global Const $htmenu = 5
Global Const $hthscroll = 6
Global Const $htvscroll = 7
Global Const $htminbutton = 8
Global Const $htmaxbutton = 9
Global Const $htleft = 10
Global Const $htright = 11
Global Const $httop = 12
Global Const $httopleft = 13
Global Const $httopright = 14
Global Const $htbottom = 15
Global Const $htbottomleft = 16
Global Const $htbottomright = 17
Global Const $htborder = 18
Global Const $htreduce = $htminbutton
Global Const $htzoom = $htmaxbutton
Global Const $htsizefirst = $htleft
Global Const $htsizelast = $htbottomright
Global Const $htobject = 19
Global Const $htclose = 20
Global Const $hthelp = 21
Global Const $color_scrollbar = 0
Global Const $color_background = 1
Global Const $color_activecaption = 2
Global Const $color_inactivecaption = 3
Global Const $color_menu = 4
Global Const $color_window = 5
Global Const $color_windowframe = 6
Global Const $color_menutext = 7
Global Const $color_windowtext = 8
Global Const $color_captiontext = 9
Global Const $color_activeborder = 10
Global Const $color_inactiveborder = 11
Global Const $color_appworkspace = 12
Global Const $color_highlight = 13
Global Const $color_highlighttext = 14
Global Const $color_btnface = 15
Global Const $color_btnshadow = 16
Global Const $color_graytext = 17
Global Const $color_btntext = 18
Global Const $color_inactivecaptiontext = 19
Global Const $color_btnhighlight = 20
Global Const $color_3ddkshadow = 21
Global Const $color_3dlight = 22
Global Const $color_infotext = 23
Global Const $color_infobk = 24
Global Const $color_hotlight = 26
Global Const $color_gradientactivecaption = 27
Global Const $color_gradientinactivecaption = 28
Global Const $color_menuhilight = 29
Global Const $color_menubar = 30
Global Const $color_desktop = 1
Global Const $color_3dface = 15
Global Const $color_3dshadow = 16
Global Const $color_3dhighlight = 20
Global Const $color_3dhilight = 20
Global Const $color_btnhilight = 20
Global Const $hinst_commctrl = -1
Global Const $idb_std_small_color = 0
Global Const $idb_std_large_color = 1
Global Const $idb_view_small_color = 4
Global Const $idb_view_large_color = 5
Global Const $idb_hist_small_color = 8
Global Const $idb_hist_large_color = 9
Global Const $startf_forceofffeedback = 128
Global Const $startf_forceonfeedback = 64
Global Const $startf_runfullscreen = 32
Global Const $startf_usecountchars = 8
Global Const $startf_usefillattribute = 16
Global Const $startf_usehotkey = 512
Global Const $startf_useposition = 4
Global Const $startf_useshowwindow = 1
Global Const $startf_usesize = 2
Global Const $startf_usestdhandles = 256
Global Const $cdds_prepaint = 1
Global Const $cdds_postpaint = 2
Global Const $cdds_preerase = 3
Global Const $cdds_posterase = 4
Global Const $cdds_item = 65536
Global Const $cdds_itemprepaint = 65537
Global Const $cdds_itempostpaint = 65538
Global Const $cdds_itempreerase = 65539
Global Const $cdds_itemposterase = 65540
Global Const $cdds_subitem = 131072
Global Const $cdis_selected = 1
Global Const $cdis_grayed = 2
Global Const $cdis_disabled = 4
Global Const $cdis_checked = 8
Global Const $cdis_focus = 16
Global Const $cdis_default = 32
Global Const $cdis_hot = 64
Global Const $cdis_marked = 128
Global Const $cdis_indeterminate = 256
Global Const $cdis_showkeyboardcues = 512
Global Const $cdis_nearhot = 1024
Global Const $cdis_othersidehot = 2048
Global Const $cdis_drophilited = 4096
Global Const $cdrf_dodefault = 0
Global Const $cdrf_newfont = 2
Global Const $cdrf_skipdefault = 4
Global Const $cdrf_notifypostpaint = 16
Global Const $cdrf_notifyitemdraw = 32
Global Const $cdrf_notifysubitemdraw = 32
Global Const $cdrf_notifyposterase = 64
Global Const $cdrf_doerase = 8
Global Const $cdrf_skippostpaint = 256
Global Const $gui_ss_default_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)

Func _arrayadd(ByRef $avarray, $vvalue)
    If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, -1)
    Local $iubound = UBound($avarray)
    ReDim $avarray[$iubound + 1]
    $avarray[$iubound] = $vvalue
    Return $iubound
EndFunc

Func _arraybinarysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
    If UBound($avarray, 0) <> 1 Then Return SetError(5, 0, -1)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(4, 0, -1)
    Local $imid = Int(($iend + $istart) / 2)
    If $avarray[$istart] > $vvalue OR $avarray[$iend] < $vvalue Then Return SetError(2, 0, -1)
    While $istart <= $imid AND $vvalue <> $avarray[$imid]
        If $vvalue < $avarray[$imid] Then
            $iend = $imid - 1
        Else
            $istart = $imid + 1
        EndIf
        $imid = Int(($iend + $istart) / 2)
    WEnd
    If $istart > $iend Then Return SetError(3, 0, -1)
    Return $imid
EndFunc

Func _arraycombinations(ByRef $avarray, $iset, $sdelim = "")
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $in = UBound($avarray)
    Local $ir = $iset
    Local $aidx[$ir]
    For $i = 0 To $ir - 1
        $aidx[$i] = $i
    Next
    Local $itotal = __array_combinations($in, $ir)
    Local $ileft = $itotal
    Local $aresult[$itotal + 1]
    $aresult[0] = $itotal
    Local $icount = 1
    While $ileft > 0
        __array_getnext($in, $ir, $ileft, $itotal, $aidx)
        For $i = 0 To $iset - 1
            $aresult[$icount] &= $avarray[$aidx[$i]] & $sdelim
        Next
        If $sdelim <> "" Then $aresult[$icount] = StringTrimRight($aresult[$icount], 1)
        $icount += 1
    WEnd
    Return $aresult
EndFunc

Func _arrayconcatenate(ByRef $avarraytarget, Const ByRef $avarraysource, $istart = 0)
    If NOT IsArray($avarraytarget) Then Return SetError(1, 0, 0)
    If NOT IsArray($avarraysource) Then Return SetError(2, 0, 0)
    If UBound($avarraytarget, 0) <> 1 Then
        If UBound($avarraysource, 0) <> 1 Then Return SetError(5, 0, 0)
        Return SetError(3, 0, 0)
    EndIf
    If UBound($avarraysource, 0) <> 1 Then Return SetError(4, 0, 0)
    Local $iuboundtarget = UBound($avarraytarget) - $istart, $iuboundsource = UBound($avarraysource)
    ReDim $avarraytarget[$iuboundtarget + $iuboundsource]
    For $i = $istart To $iuboundsource - 1
        $avarraytarget[$iuboundtarget + $i] = $avarraysource[$i]
    Next
    Return $iuboundtarget + $iuboundsource
EndFunc

Func _arraycreate($v_0, $v_1 = 0, $v_2 = 0, $v_3 = 0, $v_4 = 0, $v_5 = 0, $v_6 = 0, $v_7 = 0, $v_8 = 0, $v_9 = 0, $v_10 = 0, $v_11 = 0, $v_12 = 0, $v_13 = 0, $v_14 = 0, $v_15 = 0, $v_16 = 0, $v_17 = 0, $v_18 = 0, $v_19 = 0, $v_20 = 0)
    Local $av_array[21] = [$v_0, $v_1, $v_2, $v_3, $v_4, $v_5, $v_6, $v_7, $v_8, $v_9, $v_10, $v_11, $v_12, $v_13, $v_14, $v_15, $v_16, $v_17, $v_18, $v_19, $v_20]
    ReDim $av_array[@NumParams]
    Return $av_array
EndFunc

Func _arraydelete(ByRef $avarray, $ielement)
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    Local $iubound = UBound($avarray, 1) - 1
    If NOT $iubound Then
        $avarray = ""
        Return 0
    EndIf
    If $ielement < 0 Then $ielement = 0
    If $ielement > $iubound Then $ielement = $iubound
    Switch UBound($avarray, 0)
        Case 1
            For $i = $ielement To $iubound - 1
                $avarray[$i] = $avarray[$i + 1]
            Next
            ReDim $avarray[$iubound]
        Case 2
            Local $isubmax = UBound($avarray, 2) - 1
            For $i = $ielement To $iubound - 1
                For $j = 0 To $isubmax
                    $avarray[$i][$j] = $avarray[$i + 1][$j]
                Next
            Next
            ReDim $avarray[$iubound][$isubmax + 1]
        Case Else
            Return SetError(3, 0, 0)
    EndSwitch
    Return $iubound
EndFunc

Func _arraydisplay(Const ByRef $avarray, $stitle = "Array: ListView Display", $iitemlimit = -1, $itranspose = 0, $sseparator = "", $sreplace = "|", $sheader = "")
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    Local $idimension = UBound($avarray, 0), $iubound = UBound($avarray, 1) - 1, $isubmax = UBound($avarray, 2) - 1
    If $idimension > 2 Then Return SetError(2, 0, 0)
    If $sseparator = "" Then $sseparator = Chr(124)
    If _arraysearch($avarray, $sseparator, 0, 0, 0, 1) <> -1 Then
        For $x = 1 To 255
            If $x >= 32 AND $x <= 127 Then ContinueLoop
            Local $sfind = _arraysearch($avarray, Chr($x), 0, 0, 0, 1)
            If $sfind = -1 Then
                $sseparator = Chr($x)
                ExitLoop
            EndIf
        Next
    EndIf
    Local $vtmp, $ibuffer = 64
    Local $icollimit = 250
    Local $ioneventmode = Opt("GUIOnEventMode", 0), $sdataseparatorchar = Opt("GUIDataSeparatorChar", $sseparator)
    If $isubmax < 0 Then $isubmax = 0
    If $itranspose Then
        $vtmp = $iubound
        $iubound = $isubmax
        $isubmax = $vtmp
    EndIf
    If $isubmax > $icollimit Then $isubmax = $icollimit
    If $iitemlimit < 1 Then $iitemlimit = $iubound
    If $iubound > $iitemlimit Then $iubound = $iitemlimit
    If $sheader = "" Then
        $sheader = "Row  "
        For $i = 0 To $isubmax
            $sheader &= $sseparator & "Col " & $i
        Next
    EndIf
    Local $avarraytext[$iubound + 1]
    For $i = 0 To $iubound
        $avarraytext[$i] = "[" & $i & "]"
        For $j = 0 To $isubmax
            If $idimension = 1 Then
                If $itranspose Then
                    $vtmp = $avarray[$j]
                Else
                    $vtmp = $avarray[$i]
                EndIf
            Else
                If $itranspose Then
                    $vtmp = $avarray[$j][$i]
                Else
                    $vtmp = $avarray[$i][$j]
                EndIf
            EndIf
            $vtmp = StringReplace($vtmp, $sseparator, $sreplace, 0, 1)
            $avarraytext[$i] &= $sseparator & $vtmp
            $vtmp = StringLen($vtmp)
            If $vtmp > $ibuffer Then $ibuffer = $vtmp
        Next
    Next
    $ibuffer += 1
    Local Const $_arrayconstant_gui_dockborders = 102
    Local Const $_arrayconstant_gui_dockbottom = 64
    Local Const $_arrayconstant_gui_dockheight = 512
    Local Const $_arrayconstant_gui_dockleft = 2
    Local Const $_arrayconstant_gui_dockright = 4
    Local Const $_arrayconstant_gui_event_close = -3
    Local Const $_arrayconstant_lvif_param = 4
    Local Const $_arrayconstant_lvif_text = 1
    Local Const $_arrayconstant_lvm_getcolumnwidth = (4096 + 29)
    Local Const $_arrayconstant_lvm_getitemcount = (4096 + 4)
    Local Const $_arrayconstant_lvm_getitemstate = (4096 + 44)
    Local Const $_arrayconstant_lvm_insertitemw = (4096 + 77)
    Local Const $_arrayconstant_lvm_setextendedlistviewstyle = (4096 + 54)
    Local Const $_arrayconstant_lvm_setitemw = (4096 + 76)
    Local Const $_arrayconstant_lvs_ex_fullrowselect = 32
    Local Const $_arrayconstant_lvs_ex_gridlines = 1
    Local Const $_arrayconstant_lvs_showselalways = 8
    Local Const $_arrayconstant_ws_ex_clientedge = 512
    Local Const $_arrayconstant_ws_maximizebox = 65536
    Local Const $_arrayconstant_ws_minimizebox = 131072
    Local Const $_arrayconstant_ws_sizebox = 262144
    Local Const $_arrayconstant_taglvitem = "int Mask;int Item;int SubItem;int State;int StateMask;ptr Text;int TextMax;int Image;int Param;int Indent;int GroupID;int Columns;ptr pColumns"
    Local $iaddmask = BitOR($_arrayconstant_lvif_text, $_arrayconstant_lvif_param)
    Local $tbuffer = DllStructCreate("wchar Text[" & $ibuffer & "]"), $pbuffer = DllStructGetPtr($tbuffer)
    Local $titem = DllStructCreate($_arrayconstant_taglvitem), $pitem = DllStructGetPtr($titem)
    DllStructSetData($titem, "Param", 0)
    DllStructSetData($titem, "Text", $pbuffer)
    DllStructSetData($titem, "TextMax", $ibuffer)
    Local $iwidth = 640, $iheight = 480
    Local $hgui = GUICreate($stitle, $iwidth, $iheight, Default, Default, BitOR($_arrayconstant_ws_sizebox, $_arrayconstant_ws_minimizebox, $_arrayconstant_ws_maximizebox))
    Local $aiguisize = WinGetClientSize($hgui)
    Local $hlistview = GUICtrlCreateListView($sheader, 0, 0, $aiguisize[0], $aiguisize[1] - 26, $_arrayconstant_lvs_showselalways)
    Local $hcopy = GUICtrlCreateButton("Copy Selected", 3, $aiguisize[1] - 23, $aiguisize[0] - 6, 20)
    GUICtrlSetResizing($hlistview, $_arrayconstant_gui_dockborders)
    GUICtrlSetResizing($hcopy, $_arrayconstant_gui_dockleft + $_arrayconstant_gui_dockright + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight)
    GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_lvs_ex_gridlines, $_arrayconstant_lvs_ex_gridlines)
    GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_lvs_ex_fullrowselect, $_arrayconstant_lvs_ex_fullrowselect)
    GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_ws_ex_clientedge, $_arrayconstant_ws_ex_clientedge)
    Local $aitem
    For $i = 0 To $iubound
        If GUICtrlCreateListViewItem($avarraytext[$i], $hlistview) = 0 Then
            $aitem = StringSplit($avarraytext[$i], $sseparator)
            DllStructSetData($tbuffer, "Text", $aitem[1])
            DllStructSetData($titem, "Item", $i)
            DllStructSetData($titem, "SubItem", 0)
            DllStructSetData($titem, "Mask", $iaddmask)
            GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_insertitemw, 0, $pitem)
            DllStructSetData($titem, "Mask", $_arrayconstant_lvif_text)
            For $j = 2 To $aitem[0]
                DllStructSetData($tbuffer, "Text", $aitem[$j])
                DllStructSetData($titem, "SubItem", $j - 1)
                GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_setitemw, 0, $pitem)
            Next
        EndIf
    Next
    $iwidth = 0
    For $i = 0 To $isubmax + 1
        $iwidth += GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_getcolumnwidth, $i, 0)
    Next
    If $iwidth < 250 Then $iwidth = 230
    $iwidth += 20
    If $iwidth > @DesktopWidth Then $iwidth = @DesktopWidth - 100
    WinMove($hgui, "", (@DesktopWidth - $iwidth) / 2, Default, $iwidth)
    GUISetState(@SW_SHOW, $hgui)
    While 1
        Switch GUIGetMsg()
            Case $_arrayconstant_gui_event_close
                ExitLoop
            Case $hcopy
                Local $sclip = ""
                Local $aicuritems[1] = [0]
                For $i = 0 To GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_getitemcount, 0, 0)
                    If GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_getitemstate, $i, 2) Then
                        $aicuritems[0] += 1
                        ReDim $aicuritems[$aicuritems[0] + 1]
                        $aicuritems[$aicuritems[0]] = $i
                    EndIf
                Next
                If NOT $aicuritems[0] Then
                    For $sitem In $avarraytext
                        $sclip &= $sitem & @CRLF
                    Next
                Else
                    For $i = 1 To UBound($aicuritems) - 1
                        $sclip &= $avarraytext[$aicuritems[$i]] & @CRLF
                    Next
                EndIf
                ClipPut($sclip)
        EndSwitch
    WEnd
    GUIDelete($hgui)
    Opt("GUIOnEventMode", $ioneventmode)
    Opt("GUIDataSeparatorChar", $sdataseparatorchar)
    Return 1
EndFunc

Func _arrayfindall(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase = 0, $ipartial = 0, $isubitem = 0)
    $istart = _arraysearch($avarray, $vvalue, $istart, $iend, $icase, $ipartial, 1, $isubitem)
    If @error Then Return SetError(@error, 0, -1)
    Local $iindex = 0, $avresult[UBound($avarray)]
    Do
        $avresult[$iindex] = $istart
        $iindex += 1
        $istart = _arraysearch($avarray, $vvalue, $istart + 1, $iend, $icase, $ipartial, 1, $isubitem)
    Until @error
    ReDim $avresult[$iindex]
    Return $avresult
EndFunc

Func _arrayinsert(ByRef $avarray, $ielement, $vvalue = "")
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $iubound = UBound($avarray) + 1
    ReDim $avarray[$iubound]
    For $i = $iubound - 1 To $ielement + 1 Step -1
        $avarray[$i] = $avarray[$i - 1]
    Next
    $avarray[$ielement] = $vvalue
    Return $iubound
EndFunc

Func _arraymax(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
    Local $iresult = _arraymaxindex($avarray, $icompnumeric, $istart, $iend)
    If @error Then Return SetError(@error, 0, "")
    Return $avarray[$iresult]
EndFunc

Func _arraymaxindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
    If NOT IsArray($avarray) OR UBound($avarray, 0) <> 1 Then Return SetError(1, 0, -1)
    If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(2, 0, -1)
    Local $imaxindex = $istart
    If $icompnumeric Then
        For $i = $istart To $iend
            If Number($avarray[$imaxindex]) < Number($avarray[$i]) Then $imaxindex = $i
        Next
    Else
        For $i = $istart To $iend
            If $avarray[$imaxindex] < $avarray[$i] Then $imaxindex = $i
        Next
    EndIf
    Return $imaxindex
EndFunc

Func _arraymin(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
    Local $iresult = _arrayminindex($avarray, $icompnumeric, $istart, $iend)
    If @error Then Return SetError(@error, 0, "")
    Return $avarray[$iresult]
EndFunc

Func _arrayminindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
    If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(2, 0, -1)
    Local $iminindex = $istart
    If $icompnumeric Then
        For $i = $istart To $iend
            If Number($avarray[$iminindex]) > Number($avarray[$i]) Then $iminindex = $i
        Next
    Else
        For $i = $istart To $iend
            If $avarray[$iminindex] > $avarray[$i] Then $iminindex = $i
        Next
    EndIf
    Return $iminindex
EndFunc

Func _arraypermute(ByRef $avarray, $sdelim = "")
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $isize = UBound($avarray), $ifactorial = 1, $aidx[$isize], $aresult[1], $icount = 1
    For $i = 0 To $isize - 1
        $aidx[$i] = $i
    Next
    For $i = $isize To 1 Step -1
        $ifactorial *= $i
    Next
    ReDim $aresult[$ifactorial + 1]
    $aresult[0] = $ifactorial
    __array_exeterinternal($avarray, 0, $isize, $sdelim, $aidx, $aresult, $icount)
    Return $aresult
EndFunc

Func _arraypop(ByRef $avarray)
    If (NOT IsArray($avarray)) Then Return SetError(1, 0, "")
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, "")
    Local $iubound = UBound($avarray) - 1, $slastval = $avarray[$iubound]
    If NOT $iubound Then
        $avarray = ""
    Else
        ReDim $avarray[$iubound]
    EndIf
    Return $slastval
EndFunc

Func _arraypush(ByRef $avarray, $vvalue, $idirection = 0)
    If (NOT IsArray($avarray)) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, 0)
    Local $iubound = UBound($avarray) - 1
    If IsArray($vvalue) Then
        Local $iubounds = UBound($vvalue)
        If ($iubounds - 1) > $iubound Then Return SetError(2, 0, 0)
        If $idirection Then
            For $i = $iubound To $iubounds Step -1
                $avarray[$i] = $avarray[$i - $iubounds]
            Next
            For $i = 0 To $iubounds - 1
                $avarray[$i] = $vvalue[$i]
            Next
        Else
            For $i = 0 To $iubound - $iubounds
                $avarray[$i] = $avarray[$i + $iubounds]
            Next
            For $i = 0 To $iubounds - 1
                $avarray[$i + $iubound - $iubounds + 1] = $vvalue[$i]
            Next
        EndIf
    Else
        If $idirection Then
            For $i = $iubound To 1 Step -1
                $avarray[$i] = $avarray[$i - 1]
            Next
            $avarray[0] = $vvalue
        Else
            For $i = 0 To $iubound - 1
                $avarray[$i] = $avarray[$i + 1]
            Next
            $avarray[$iubound] = $vvalue
        EndIf
    EndIf
    Return 1
EndFunc

Func _arrayreverse(ByRef $avarray, $istart = 0, $iend = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, 0)
    Local $vtmp, $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(2, 0, 0)
    For $i = $istart To Int(($istart + $iend - 1) / 2)
        $vtmp = $avarray[$i]
        $avarray[$i] = $avarray[$iend]
        $avarray[$iend] = $vtmp
        $iend -= 1
    Next
    Return 1
EndFunc

Func _arraysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase = 0, $ipartial = 0, $iforward = 1, $isubitem = -1)
    If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
    If UBound($avarray, 0) > 2 OR UBound($avarray, 0) < 1 Then Return SetError(2, 0, -1)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(4, 0, -1)
    Local $istep = 1
    If NOT $iforward Then
        Local $itmp = $istart
        $istart = $iend
        $iend = $itmp
        $istep = -1
    EndIf
    Switch UBound($avarray, 0)
        Case 1
            If NOT $ipartial Then
                If NOT $icase Then
                    For $i = $istart To $iend Step $istep
                        If $avarray[$i] = $vvalue Then Return $i
                    Next
                Else
                    For $i = $istart To $iend Step $istep
                        If $avarray[$i] == $vvalue Then Return $i
                    Next
                EndIf
            Else
                For $i = $istart To $iend Step $istep
                    If StringInStr($avarray[$i], $vvalue, $icase) > 0 Then Return $i
                Next
            EndIf
        Case 2
            Local $iuboundsub = UBound($avarray, 2) - 1
            If $isubitem > $iuboundsub Then $isubitem = $iuboundsub
            If $isubitem < 0 Then
                $isubitem = 0
            Else
                $iuboundsub = $isubitem
            EndIf
            For $j = $isubitem To $iuboundsub
                If NOT $ipartial Then
                    If NOT $icase Then
                        For $i = $istart To $iend Step $istep
                            If $avarray[$i][$j] = $vvalue Then Return $i
                        Next
                    Else
                        For $i = $istart To $iend Step $istep
                            If $avarray[$i][$j] == $vvalue Then Return $i
                        Next
                    EndIf
                Else
                    For $i = $istart To $iend Step $istep
                        If StringInStr($avarray[$i][$j], $vvalue, $icase) > 0 Then Return $i
                    Next
                EndIf
            Next
        Case Else
            Return SetError(7, 0, -1)
    EndSwitch
    Return SetError(6, 0, -1)
EndFunc

Func _arraysort(ByRef $avarray, $idescending = 0, $istart = 0, $iend = 0, $isubitem = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(2, 0, 0)
    Switch UBound($avarray, 0)
        Case 1
            __arrayquicksort1d($avarray, $istart, $iend)
            If $idescending Then _arrayreverse($avarray, $istart, $iend)
        Case 2
            Local $isubmax = UBound($avarray, 2) - 1
            If $isubitem > $isubmax Then Return SetError(3, 0, 0)
            If $idescending Then
                $idescending = -1
            Else
                $idescending = 1
            EndIf
            __arrayquicksort2d($avarray, $idescending, $istart, $iend, $isubitem, $isubmax)
        Case Else
            Return SetError(4, 0, 0)
    EndSwitch
    Return 1
EndFunc

Func __arrayquicksort1d(ByRef $avarray, ByRef $istart, ByRef $iend)
    If $iend <= $istart Then Return
    Local $vtmp
    If ($iend - $istart) < 15 Then
        Local $vcur
        For $i = $istart + 1 To $iend
            $vtmp = $avarray[$i]
            If IsNumber($vtmp) Then
                For $j = $i - 1 To $istart Step -1
                    $vcur = $avarray[$j]
                    If ($vtmp >= $vcur AND IsNumber($vcur)) OR (NOT IsNumber($vcur) AND StringCompare($vtmp, $vcur) >= 0) Then ExitLoop
                    $avarray[$j + 1] = $vcur
                Next
            Else
                For $j = $i - 1 To $istart Step -1
                    If (StringCompare($vtmp, $avarray[$j]) >= 0) Then ExitLoop
                    $avarray[$j + 1] = $avarray[$j]
                Next
            EndIf
            $avarray[$j + 1] = $vtmp
        Next
        Return
    EndIf
    Local $l = $istart, $r = $iend, $vpivot = $avarray[Int(($istart + $iend) / 2)], $fnum = IsNumber($vpivot)
    Do
        If $fnum Then
            While ($avarray[$l] < $vpivot AND IsNumber($avarray[$l])) OR (NOT IsNumber($avarray[$l]) AND StringCompare($avarray[$l], $vpivot) < 0)
                $l += 1
            WEnd
            While ($avarray[$r] > $vpivot AND IsNumber($avarray[$r])) OR (NOT IsNumber($avarray[$r]) AND StringCompare($avarray[$r], $vpivot) > 0)
                $r -= 1
            WEnd
        Else
            While (StringCompare($avarray[$l], $vpivot) < 0)
                $l += 1
            WEnd
            While (StringCompare($avarray[$r], $vpivot) > 0)
                $r -= 1
            WEnd
        EndIf
        If $l <= $r Then
            $vtmp = $avarray[$l]
            $avarray[$l] = $avarray[$r]
            $avarray[$r] = $vtmp
            $l += 1
            $r -= 1
        EndIf
    Until $l > $r
    __arrayquicksort1d($avarray, $istart, $r)
    __arrayquicksort1d($avarray, $l, $iend)
EndFunc

Func __arrayquicksort2d(ByRef $avarray, ByRef $istep, ByRef $istart, ByRef $iend, ByRef $isubitem, ByRef $isubmax)
    If $iend <= $istart Then Return
    Local $vtmp, $l = $istart, $r = $iend, $vpivot = $avarray[Int(($istart + $iend) / 2)][$isubitem], $fnum = IsNumber($vpivot)
    Do
        If $fnum Then
            While ($istep * ($avarray[$l][$isubitem] - $vpivot) < 0 AND IsNumber($avarray[$l][$isubitem])) OR (NOT IsNumber($avarray[$l][$isubitem]) AND $istep * StringCompare($avarray[$l][$isubitem], $vpivot) < 0)
                $l += 1
            WEnd
            While ($istep * ($avarray[$r][$isubitem] - $vpivot) > 0 AND IsNumber($avarray[$r][$isubitem])) OR (NOT IsNumber($avarray[$r][$isubitem]) AND $istep * StringCompare($avarray[$r][$isubitem], $vpivot) > 0)
                $r -= 1
            WEnd
        Else
            While ($istep * StringCompare($avarray[$l][$isubitem], $vpivot) < 0)
                $l += 1
            WEnd
            While ($istep * StringCompare($avarray[$r][$isubitem], $vpivot) > 0)
                $r -= 1
            WEnd
        EndIf
        If $l <= $r Then
            For $i = 0 To $isubmax
                $vtmp = $avarray[$l][$i]
                $avarray[$l][$i] = $avarray[$r][$i]
                $avarray[$r][$i] = $vtmp
            Next
            $l += 1
            $r -= 1
        EndIf
    Until $l > $r
    __arrayquicksort2d($avarray, $istep, $istart, $r, $isubitem, $isubmax)
    __arrayquicksort2d($avarray, $istep, $l, $iend, $isubitem, $isubmax)
EndFunc

Func _arrayswap(ByRef $vitem1, ByRef $vitem2)
    Local $vtmp = $vitem1
    $vitem1 = $vitem2
    $vitem2 = $vtmp
EndFunc

Func _arraytoclip(Const ByRef $avarray, $istart = 0, $iend = 0)
    Local $sresult = _arraytostring($avarray, @CR, $istart, $iend)
    If @error Then Return SetError(@error, 0, 0)
    Return ClipPut($sresult)
EndFunc

Func _arraytostring(Const ByRef $avarray, $sdelim = "|", $istart = 0, $iend = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, "")
    If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, "")
    Local $sresult, $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(2, 0, "")
    For $i = $istart To $iend
        $sresult &= $avarray[$i] & $sdelim
    Next
    Return StringTrimRight($sresult, StringLen($sdelim))
EndFunc

Func _arraytrim(ByRef $avarray, $itrimnum, $idirection = 0, $istart = 0, $iend = 0)
    If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
    If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $iubound = UBound($avarray) - 1
    If $iend < 1 OR $iend > $iubound Then $iend = $iubound
    If $istart < 0 Then $istart = 0
    If $istart > $iend Then Return SetError(5, 0, 0)
    If $idirection Then
        For $i = $istart To $iend
            $avarray[$i] = StringTrimRight($avarray[$i], $itrimnum)
        Next
    Else
        For $i = $istart To $iend
            $avarray[$i] = StringTrimLeft($avarray[$i], $itrimnum)
        Next
    EndIf
    Return 1
EndFunc

Func _arrayunique($aarray, $idimension = 1, $ibase = 0, $icase = 0, $vdelim = "|")
    Local $iubounddim
    If $vdelim = "|" Then $vdelim = Chr(1)
    If NOT IsArray($aarray) Then Return SetError(1, 0, 0)
    If NOT $idimension > 0 Then
        Return SetError(3, 0, 0)
    Else
        $iubounddim = UBound($aarray, 1)
        If @error Then Return SetError(3, 0, 0)
        If $idimension > 1 Then
            Local $aarraytmp[1]
            For $i = 0 To $iubounddim - 1
                _arrayadd($aarraytmp, $aarray[$i][$idimension - 1])
            Next
            _arraydelete($aarraytmp, 0)
        Else
            If UBound($aarray, 0) = 1 Then
                Dim $aarraytmp[1]
                For $i = 0 To $iubounddim - 1
                    _arrayadd($aarraytmp, $aarray[$i])
                Next
                _arraydelete($aarraytmp, 0)
            Else
                Dim $aarraytmp[1]
                For $i = 0 To $iubounddim - 1
                    _arrayadd($aarraytmp, $aarray[$i][$idimension - 1])
                Next
                _arraydelete($aarraytmp, 0)
            EndIf
        EndIf
    EndIf
    Local $shold
    For $icc = $ibase To UBound($aarraytmp) - 1
        If NOT StringInStr($vdelim & $shold, $vdelim & $aarraytmp[$icc] & $vdelim, $icase) Then $shold &= $aarraytmp[$icc] & $vdelim
    Next
    If $shold Then
        $aarraytmp = StringSplit(StringTrimRight($shold, StringLen($vdelim)), $vdelim, 1)
        Return $aarraytmp
    EndIf
    Return SetError(2, 0, 0)
EndFunc

Func __array_exeterinternal(ByRef $avarray, $istart, $isize, $sdelim, ByRef $aidx, ByRef $aresult, ByRef $icount)
    If $istart == $isize - 1 Then
        For $i = 0 To $isize - 1
            $aresult[$icount] &= $avarray[$aidx[$i]] & $sdelim
        Next
        If $sdelim <> "" Then $aresult[$icount] = StringTrimRight($aresult[$icount], 1)
        $icount += 1
    Else
        Local $itemp
        For $i = $istart To $isize - 1
            $itemp = $aidx[$i]
            $aidx[$i] = $aidx[$istart]
            $aidx[$istart] = $itemp
            __array_exeterinternal($avarray, $istart + 1, $isize, $sdelim, $aidx, $aresult, $icount)
            $aidx[$istart] = $aidx[$i]
            $aidx[$i] = $itemp
        Next
    EndIf
EndFunc

Func __array_combinations($in, $ir)
    Local $i_total = 1
    For $i = $ir To 1 Step -1
        $i_total *= ($in / $i)
        $in -= 1
    Next
    Return Round($i_total)
EndFunc

Func __array_getnext($in, $ir, ByRef $ileft, $itotal, ByRef $aidx)
    If $ileft == $itotal Then
        $ileft -= 1
        Return
    EndIf
    Local $i = $ir - 1
    While $aidx[$i] == $in - $ir + $i
        $i -= 1
    WEnd
    $aidx[$i] += 1
    For $j = $i + 1 To $ir - 1
        $aidx[$j] = $aidx[$i] + $j - $i
    Next
    $ileft -= 1
EndFunc

Opt("MustDeclareVars", 1)
example()

Func example()
    Local $button_1, $button_2, $button_3, $button_4
    Local $halt, $msg
    Local $aleg_ini, $bleg_ini, $cleg_ini, $dleg_ini, $host
    Opt("GUICoordMode", 1)
    GUICreate("IE Killer", 140, 260, $ws_ex_topmost)
    $button_1 = GUICtrlCreateButton("A Leg", 20, 20, 100, 40)
    $button_2 = GUICtrlCreateButton("B Leg", 20, 80, 100, 40)
    $button_3 = GUICtrlCreateButton("C Leg", 20, 140, 100, 40)
    $button_4 = GUICtrlCreateButton("D Leg", 20, 200, 100, 40)
    $aleg_ini = IniReadSection("ALeg_ini.ini", "ALeg")
    $bleg_ini = IniReadSection("BLeg_ini.ini", "BLeg")
    $cleg_ini = IniReadSection("CLeg_ini.ini", "CLeg")
    $dleg_ini = IniReadSection("DLeg_ini.ini", "DLeg")
    Local $arraleg[$aleg_ini[0][0]]
    Local $arrbleg[$bleg_ini[0][0]]
    Local $arrcleg[$cleg_ini[0][0]]
    Local $arrdleg[$dleg_ini[0][0]]
    For $i = 1 To $aleg_ini[0][0]
        $arraleg[$i - 1] = $aleg_ini[$i][1]
    Next
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $gui_event_close
                Exit
            Case $msg = $gui_event_minimize
            Case $msg = $gui_event_maximize
            Case $msg = $button_1
                For $host In $arraleg
                    Run(@ComSpec & "\\" & $host & " RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", '', @SW_SHOW)
                Next
            Case $msg = $button_2
                For $host In $arrbleg
                    Run(@ComSpec & " /c taskkill /s \\" & $host & " /F /IM iexplore.exe", '', @SW_SHOW)
                Next
            Case $msg = $button_3
                For $host In $arrcleg
                    Run(@ComSpec & " /c taskkill /s \\" & $host & " /F /IM iexplore.exe", '', @SW_SHOW)
                Next
            Case $msg = $button_4
                For $host In $arrdleg
                    Run(@ComSpec & " /c taskkill /s \\" & $host & " /F /IM iexplore.exe", '', @SW_SHOW)
                Next
            Case $halt = $msg
        EndSelect
    WEnd
    GUIDelete()
EndFunc

I am not sure that the Code I put in to Clear the cache is working (see below):

Run(@ComSpec & "\\" & $host & " RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", '', @SW_SHOW)

Share this post


Link to post
Share on other sites



well all im gona say is the "global const" part is where all the variables are declared.  you have alot of functions in there but i couldn't find one called, so it basically does nothing as it sits.  Besides that if you don't know much about it you need to start at the basics and work your way up.

Share this post


Link to post
Share on other sites

Would you know how to run a clear cache command? I have the taskkill IE working? I'm researching more about how this program works

Share this post


Link to post
Share on other sites

I'd guess it would be something like this here... '?do=embed' frameborder='0' data-embedContent>>

Mind you it took me less than 30 seconds to Google that and look at post and post it

I was able to find how to clear the cache and temp internet folder the Problem I am having is being able to execute that remotely because when I run the command it clears the IE cache on my computer or doesn't work at all. 

Share this post


Link to post
Share on other sites

The code you supplied in your post seems to be from the Includes "GUIConstantsEx" and "Array". Other then that, much like markyrocks  posted above, I don't see any code to do anything.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The code you supplied in your post seems to be from the Includes "GUIConstantsEx" and "Array". Other then that, much like markyrocks  posted above, I don't see any code to do anything.

Hmm I am wondering why the following code:

Run(@ComSpec & " /c taskkill /s \\" & $host & " /F /IM iexplore.exe", '', @SW_SHOW)

works really well but can't do a simple clear cache remotely. I tried putting the code markyrocks suggested in but it want to run on my computer not the remote computer

Edited by swstrau118

Share this post


Link to post
Share on other sites

Taskkill will run on a remote computer, your code will not, it will run wherever the script is being executed from, as I told you in your other thread.

1 person likes this

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

The post that I pointed you to wasn't meant to be a cure all end all. Just a nudge in (what I thought) was the right direction.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0