Jump to content

pietrog

Members
  • Posts

    8
  • Joined

  • Last visited

pietrog's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks - that worked perfectly.
  2. Looking to have the script quit when either the mouse is moved or any key is pressed. The keypress doesn't seem to trigger when I create the picture control. If I comment out the GUICtrlCreatePic line, it works. If I leave it in, only the mouse move will terminate the script. I'd appreciate any insight. Thanks #include <GUIConstants.au3> Global Const $WM_KEYDOWN = 0x0100 Opt("RunErrorsFatal", 0) Opt("GUIOnEventMode", 1) $hGUI = GUICreate('test',300,200, 0, 0) GUIRegisterMsg($WM_KEYDOWN, 'Terminate') GUISetOnEvent($GUI_EVENT_MOUSEMOVE, 'TermEvent') $pic = GUICtrlCreatePic(@WindowsDir & '\lanma256.bmp', 10, 10, 0, 0) GUISetState() While 1 WEnd Func Terminate($hWnd, $msg, $wParam, $lParam) Exit EndFunc ;==>Terminate Func TermEvent() Exit EndFunc ;==>TermEvent
  3. I've tested it with UltraVNC. The script creates the VNC service on the remote pc, starts the vncviewer program locally, and establishes a connection between the two. I'm in a domain environment with admin rights on both pcs.
  4. This script will install UltraVNC on a remote computer. You need to have the following files in your @ScriptDir vnchooks.dll, winVNC.exe, and vncviewer.exe. The script uses WMI to install the service on the remote PC and to determine the Windows Directory. After the viewer is closed, the script will clean up after itself on the local and remote PC. $compname = INPUTBOX("Remote Control", "Remote Control Address", "", "", -1, 120) Ping($compname) If @error Then MsgBox(0,"error", "PC not alive") Exit EndIf RegWrite("\\" & $compname & "\HKLM\SOFTWARE\ORL\WinVNC3", "AuthRequired", "REG_DWORD", "1") RegWrite("\\" & $compname & "\HKLM\SOFTWARE\ORL\WinVNC3", "DisableTrayIcon", "REG_DWORD", "1") RegWrite("\\" & $compname & "\HKLM\SOFTWARE\ORL\WinVNC3\Default", "Password", "REG_BINARY", "DBD83CFD727A1458") FileInstall("vnchooks.dll", "\\" & $compname & "\admin$\temp\vnchooks.dll") FileInstall("winVNC.exe", "\\" & $compname & "\admin$\temp\winVNC.exe") FileInstall("vncviewer.exe", @ScriptDir & "\viewer.exe") $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $compname & "\root\cimv2") $colItems = $objWMIService.ExecQuery("Select * From Win32_OperatingSystem") For $objItem in $colItems $windir=$objItem.WindowsDirectory Next $objNewService = $objWMIService.Get ("Win32_Service") $errReturn = $objNewService.Create ("VNC", "VNC", $windir & "\temp\winVNC.exe -service", "16", "0", "Manual", "1") $colListOfServices = $objWMIService.ExecQuery ("Select * from Win32_Service Where Name = 'VNC'") For $objNewService in $colListOfServices $objNewService.StartService() Next Sleep(1000) RunWait(@ScriptDir & "\viewer.exe -connect " & $compname & " -password password -nostatus") For $objNewService in $colListOfServices $objNewService.StopService() $objNewService.Delete() Next Sleep(1000) FileDelete("\\" & $compname & "\admin$\temp\vnchooks.dll") FileDelete("\\" & $compname & "\admin$\temp\winVNC.exe") FileDelete(@ScriptDir & "\viewer.exe") RegDelete("\\" & $compname & "\HKLM\SOFTWARE\UltraVNC") RegDelete("\\" & $compname & "\HKCU\SOFTWARE\ORL") RegDelete("HKCU\SOFTWARE\ORL")
  5. Awesome! That's what I was looking for. Now All I have to do is spend some time digesting the code. Thanks All
  6. Thanks, I changed my code to yours - but my problem is that when the value '121' is displayed at the bottom of the listbox the scrollbar slider starts to shrink instead of displaying '122' etc. at the bottom of the window. So, I'm left with grabing the slider and manually scrolling down to see the values as they are entered into the list. I was hoping it was possible to have it display the new items in the listbox window as they are added without using the scrollbar slider to display them.
  7. Is there a listbox style that will always display the last item added to the list by default? When I run the following code, the scroll bar appears after I add more items to the list than the listbox can display. As I continue to add items, the scroll bar slider shrinks but the listbox continues to display the same items as before. I'd like to have the listbox display the new items I add as I add them to the list instead. Thanks for any input #include <GuiConstants.au3> GUICreate('ListBox') $mylist = GUICtrlCreateList('', 50, 50, 300, 300) GUISetState() For $i = 1 To 100 Sleep(100) GUICtrlSetData($mylist, $i & '|') Next Sleep(10000)
×
×
  • Create New...