Jump to content

bab

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by bab

  1. I need to change/edit the password on a system dsn that uses sql authentication. I need to modify this on 400 workstations. I wrote the following to change the password: run("rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl",@SystemDir,@SW_HIDE) winwait("ODBC Data Source Administrator") ControlCommand ( "ODBC Data Source Administrator", "", "SysTabControl321" , "tabright") Send("!c") winwait("Microsoft SQL Server DSN Configuration") WinWaitActive("Microsoft SQL Server DSN Configuration", "This wizard") Send("!n") WinWaitActive("Microsoft SQL Server DSN Configuration", "How should") Send("!P") sleep(100) send("newpassword") sleep(100) Send("!n") WinWaitActive("Microsoft SQL Server DSN Configuration", "") Send("!n") WinWaitActive("Microsoft SQL Server DSN Configuration", "&Change the language of SQL Server system messages to") Send("!c") Send("{ENTER}") winwait("ODBC Microsoft SQL Server Setup") send("!t") WinWaitActive("SQL Server ODBC Data Source Test", "Test Results") Send("{ENTER}") winwait("ODBC Microsoft SQL Server Setup") send("{TAB}") sleep(100) Send("{ENTER}") winwait("ODBC Data Source Administrator") Send("{ENTER}") My dilemma is that I have more than one system dsn. I cannot get to the right system dsn to edit (click the configure button). The editor does not show this list or text. How can I move to the right dsn to modify. This is for 3rd party software; I have to use sql authentication. Thanks to anyone that can help.
  2. I am able to open pdf files if I have a mapped drive to the file: _IENavigate($oIE, "h:\folder\subfolder\report.pdf", 0) I get paged cannot be displayed if it is a unc: _IENavigate($oIE, "\\server\folder\subfolder\report.pdf", 0) Is there a way to make this work with unc. Thanks.
  3. I admit that I do not understand the _wm_notify function. I created a treeview menu for server documentation: +Server1 +backup -filename +baseline -filename +configuration -filename +Server2 +backup -filename +baseline -filename +configuration -filename +Server3 +backup -filename +baseline -filename +configuration -filename I only want the function to respond to a double click on the filenames. Any help would be greatly appreciated. Thank You. ==== Func _WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) ; ConsoleWrite('@@ (28) ' & @MIN & ':' & @SEC & ') WM_NOTIFY()' & @CR) ;### Function Trace Local $tNMHDR, $hWndFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam); creates a c/c++ style structure, structure is $tagNMHDR, $1Param is the pointer $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom");$tNMHDR is the structure created. $iCode = DllStructGetData($tNMHDR, "Code"); get returned data Switch $hWndFrom Case $hTreeView Switch $iCode Case $NM_CLICK ; The user has clicked the left mouse button within the control Local $tPOINT = DllStructCreate("int X;int Y") DllStructSetData($tPOINT, "X", MouseGetPos(0)) DllStructSetData($tPOINT, "Y", MouseGetPos(1)) _ScreenToClient($hTreeView, $tPOINT) Local $iX = DllStructGetData($tPOINT, "X") Local $iY = DllStructGetData($tPOINT, "Y") Local $iItem = _GUICtrlTreeView_HitTestItem($hTreeView, $iX, $iY) If $iItem <> 0 Then $vSelected = _GUICtrlTreeView_GetText($hTreeView, $iItem) & ".pdf" ToolTip($vSelected, 0, 0) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func _ScreenToClient($hWnd, $tPOINT) ConsoleWrite('@@ (58) ' & @MIN & ':' & @SEC & ') _ScreenToClient()' & @CR) ;### Function Trace Local $aRet = DllCall("user32.dll", "int", "ScreenToClient", "hwnd", $hTreeView, "ptr", DllStructGetPtr($tPOINT)) Return $aRet[0] EndFunc ;==>_ScreenToClient
  4. I am trying (stress trying) to create a server documentation app using treeview. So far the menu looks like: +Servers -filesrv01 -htmdoc1 -htmldoc2 -dhtmloc3 -filesrv02 -htmldoc1 -htmldoc2 -htmldoc3 -filesrv03 -htmldoc1 -htmldoc2 -htmldoc3 My question: How do I write the code to showing that I selected for example filesrv03, doc3 and show that doc in a window using explorer. Thanks for your help. My code so far: #include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <GuiTab.au3> #include <Array.au3> Global $hGUI, $hTreeView, $hTemp, $docs, $idButton Dim $srvlst Local $aArray[5] = ["Backup", "Baseline", "ChangeControl", "ComplianceCheck", "Configuration"]; subitems, documents for each server Local $j $hGUI = GUICreate("Server Compliance Reports", 1696, 1000) $hTreeView = _GUICtrlTreeView_Create($hGUI, 30, 30, 200, 880) $hTemp = _GUICtrlTreeView_Add($hTreeView, 0, "Server Compliance Reports") $hTemp = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, "Servers") $srvlst = IniReadSection("servers.ini", "Servers") For $i = 1 To $srvlst[0][0] Step +1 $docs = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, $srvlst[$i][1]) For $j = 0 to 5 - 1 _GUICtrlTreeView_AddChild($hTreeView, $docs, $aArray[$j]) Next Next $idButton = GUICtrlCreateButton("Close", 280, 120) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idButton Exit EndSwitch WEnd
  5. Thank You so much. I was at a stand still. Greatly appreciated.
  6. Would someone mind helping me. I created an inifile,called servers.ini. Sample contents of the file: [servers] 1=myserver1 2=myserver2 3=myserver3 4=myserver4 I am reading the file into an array. I want to create a menu to display the list of servers. Once the app is completed, a server will be selected and something will be performed on the server. I need to know how to display just the server names in the list view and not the keys (1,2,3,4, etc. Here's my code: thanks. The code below returns both columns. I just want to see the column with myserver1, myserver2, etc. #include <GUIConstants.au3> #include <GUIListBox.au3> #include <GuiListView.au3> #include <Process.au3> include <constants.au3> #include <array.au3> AutoItSetOption ("ExpandVarStrings" , 1) Local $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES) Dim $srvlst $mnuapp = GUICreate("Servers" , 400, 500,-1, -1, -1, 0x00000018); WS_EX_ACCEPTFILES $listview = _GUICtrlListView_Create ($mnuapp,"", 10, 32, 300, 197) _GUICtrlListView_SetExtendedListViewStyle($listview, $exStyles) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, "") GUISetState() $srvlst = IniReadSection("servers.ini", "Servers") _GUICtrlListView_AddColumn($listview, "Servers", 120) _GUICtrlListView_AddArray ($listview, $srvlst) _GUICtrlListView_SetItemSelected($listview, 0)
×
×
  • Create New...