Jump to content

Andy2520

Active Members
  • Posts

    41
  • Joined

  • Last visited

Andy2520's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Thanks for reply , I not getting how do send query to LDAP domino server . get details of user in one variable . Please suggest if you have any idea .
  2. Dear Team, I am trying to pull the user name , domino server name from the Domino Lotus notes LDAP server . Any one has idea how to pull details through the LDAP query . I have gone through few forum i have found only how to Pull user details from the AD . Please suggest .
  3. Thanks Water So sorry i have asked stupid help ..Simple issue . tried its working fine .. thank you so much
  4. Thanks Water for your reply!! . if one cell is empty or doesnot have any content it should exit the script .in above code script reading till last cell i.e For $i = 2 To 3. I need as soon as if get empty value frm cell it should exit .
  5. Dear Team, I am creating one script it should read the content of Ms excel cell if content is there script should process .If content is not there in cell script should exit with msg box . Here is the code .could you please help me in the same . #include <Excel.au3> #include <MsgBoxConstants.au3> Local $oExcel = _ExcelBookOpen("d:\ani.xls",0) ;Local $oExcel = _ExcelBookNew() ;Create new book, make it visible ;For $i = 1 To 5 ;Loop ; _ExcelWriteCell($oExcel, $i, $i, 1) ;Write to the Cell ;Next Local $sCellValue, $sCellValue1 ,$splitsrname1,$splitsrnameyear,$splitsrnamedate,$splitsrnamemonth,$splitsrnamemonth1 For $i = 2 To 3 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) $sCellValue1 = _ExcelReadCell($oExcel, $i, 2) $splitsrname1 = StringLeft($sCellValue1, 8) $splitsrnameyear = StringLeft($splitsrname1,4) $splitsrnamedate = Stringright($splitsrname1,2) $splitsrnamemonth =Stringright($splitsrname1,4) $splitsrnamemonth1 =StringLeft($splitsrnamemonth,2) dim $DOB =$splitsrnamedate&$splitsrnamemonth1&$splitsrnameyear MsgBox($MB_SYSTEMMODAL, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) MsgBox($MB_SYSTEMMODAL, "", "The Cell Value is: " & @CRLF & $splitsrnameyear , 2) MsgBox($MB_SYSTEMMODAL, "", "The Cell Value is: " & @CRLF & $splitsrnamedate , 2) MsgBox($MB_SYSTEMMODAL, "", "The Cell Value is: " & @CRLF & $splitsrnamemonth1 , 2) MsgBox($MB_SYSTEMMODAL, "", "The Cell Value is: " & @CRLF & $DOB, 2) if $sCellValue =" " then MsgBox($MB_SYSTEMMODAL, "test", "there is no data in cell now exit") Exit EndIf Next
  6. Hi All, I have created small function i.e Error .I guess you may be knowing when we are configuring the lotus notes that time Id file may get different errors . i.e Account lockout Id file password expire You are not authorized etc .. I have developed the lotus notes auto config script ,I will be calling this error function before launch the lotus notes and checking the error msg of id files and taking action accordingly . Its seems this loop taking lot of time and some time it will hung the lotus notes. .Do you have any suggestion how to make this loop more faster . func Error1() Do ;Password Expired Sleep(2000) Opt("WinTextMatchMode",2) $sText = WinGetText("IBM Notes") If StringInStr($sText, "You must change your password. It expired on") Then MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit Sleep(1000) EndIf ;Controlclick("Notes Single Logon Password Synchronization","","Button1") sleep(9000) ;Server not responding If WinExists ("IBM Notes","The server is not responding. The server may be down or you may be experiencing network problems. Contact your system administrator if this problem persists.")or WinActivate("IBM Notes","The server is not responding. The server may be down or you may be experiencing network problems. Contact your system administrator if this problem persists.")Then Sleep(2000) MsgBox(16,"Error","Lotus notes client is not connecting to server please check if the local area network is proper !!! ") WEnd EndIf If WinExists ("Notes Single Logon Password Synchronization","")or WinActivate("Notes Single Logon Password Synchronization","")Then sleep(1000) send("{Space}") TrayTip("Lotus Notes Auto Config ", "Please Enter the lotus notes password and hit enter ", 10) WinWaitActive("IBM Notes","") ;Controlclick("Notes Single Logon Password Synchronization","","Button1") sleep(2000) EndIf If WinExists("IBM Notes","Server Error: You are not authorized to use the server" )or WinActivate ("IBM Notes","Server Error: You are not authorized to use the server" )Then sleep(2000) MsgBox(16,"Error","ID file has issue contact IT team ") Exit EndIf ; ID file is not select If WinExists("Enter New User ID File Name") or WinActivate("Enter New User ID File Name")Then Sleep(2000) MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") EndIf ; Could not open id file If WinExists("IBM Notes","Could not open the ID file")or WinActivate("IBM Notes","Could not open the ID file")Then sleep(2000) MsgBox(16,"Error","ID file has issue contact IT team ") Exit EndIf ; User name not found in Domino Directory IF WinExists("IBM Notes","User name not found in Domino Directory")or WinActivate("IBM Notes","User name not found in Domino Directory")Then Sleep(2000) Controlclick("IBM Notes", "","Button1") MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf If WinExists("Choose file to be used as current User ID","")or WinActivate("Choose file to be used as current User ID","")Then sleep(2000) MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf If WinExists("IBM Notes","IBM Notes is not currently set as your default email program. Would you like to set it now?")or WinActivate("IBM Notes","IBM Notes is not currently set as your default email program. Would you like to set it now?")Then send("!y") sleep(1000) EndIf If WinExists("IBM Notes","Could not open the ID file")or WinActivate("IBM Notes","Could not open the ID file")Then Controlclick("IBM Notes", "","Button1") Sleep(2000) MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf If WinExists ("IBM Notes","You are not authorized to access that database")or WinActivate("IBM Notes","You are not authorized to access that database")Then sleep(2000) MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf If WinExists ("IBM Notes","Error updating local ID file: The information in the supplied certificates from the Address Book entry is out of date .")or WinActivate("IBM Notes","Error updating local ID file: The information in the supplied certificates from the Address Book entry is out of date .")Then sleep(1000) send("{Space}") EndIf If WinExists("Execution Security Alert","") or WinActivate("Execution Security Alert","")Then Sleep(1000) send("!s") sleep(1000) send("{Tab}") send("{Space}") Sleep(2000) EndIf ;Account lockout If WinExists("IBM Notes","Server Error: Your account is locked out; see your system administrator to reset it")or WinActivate("IBM Notes","Server Error: Your account is locked out; see your system administrator to reset it")Then Sleep(2000) MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") $sProcName = "cmd.exe" While ProcessExists($sProcName) ProcessClose($sProcName) WEnd Exit EndIf ;different password on another copy of your ID file If WinExists("IBM Notes","You have a different password on another copy of your ID file and you must change the password on this copy to match") or WinActivate("IBM Notes","You have a different password on another copy of your ID file and you must change the password on this copy to match")Then Sleep(2000) Controlclick("IBM Notes", "","Button1") MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") $sProcName = "cmd.exe" Exit EndIf ; Certificate Expire if WinExists("IBM Notes","Server Error: Your certificate has expired") or WinActivate("IBM Notes","Server Error: Your certificate has expired")Then Sleep(2000) Controlclick("IBM Notes", "","Button1") MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf If WinActive("IBM Notes Social Edition Client Configuration")or WinExists("IBM Notes Social Edition Client Configuration")Then Sleep(1000) send("!n") ;Controlclick("IBM Notes Social Edition Client Configuration", "","IRIS.bmpbutton1") if WinExists ("Notes Single Logon Password Synchronization","")or WinActivate("Notes Single Logon Password Synchronization","")Then sleep(1000) send("{Space}") MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue Please Contact IT Team ") Exit EndIf EndIf Until WinExists("Discover - IBM Notes") WinWaitActive("Discover - IBM Notes") EndFunc
  7. Dear Team, I am planning to develop one small project i.e take input from the user and send mail to Support Team, Please find the below code and GUI . In this case :I have SMTP server it work in my system since access has been given to my IP to accept the mails . If i try to run the script from any other system its not working,We cant give access to all users IP address in SMTP server to accept mails . How do we deal this issue ,script should work from any system . Requiremet : Once user submit the mail it should come to one server or one IP address from that IP mail should send to Smtp server Please Suggest your input . #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> $hGUI = GUICreate( "New Window", 468, 324, -1, -1) $hLabel = GUICtrlCreateLabel( "Report Issue ", 143, 22, 132, 24) GUICtrlSetFont( -1, 10, 800, 0) $hLabel2 = GUICtrlCreateLabel( "User Name ", 33, 74, 87, 19) GUICtrlSetFont( -1, 8.5, 800, 0) $hLabel3 = GUICtrlCreateLabel( "Contact Number ", 35, 106, 104, 19) GUICtrlSetFont( -1, 8.5, 800, 0) $hLabel4 = GUICtrlCreateLabel( "IP address", 35, 142, 89, 19) GUICtrlSetFont( -1, 8.5, 800, 0) $hLabel5 = GUICtrlCreateLabel( "Host Name ", 35, 175, 88, 16) GUICtrlSetFont( -1, 8.5, 800, 0) $hLabel6 = GUICtrlCreateLabel( "Issue ", 39, 208, 74, 16) GUICtrlSetFont( -1, 8.5, 800, 0) $hInput = GUICtrlCreateInput( "", 146, 70, 187, 18) $hInput2 = GUICtrlCreateInput( "", 146, 106, 187, 22) $hEdit = GUICtrlCreateEdit( "", 146, 146, 187, 15) $hEdit2 = GUICtrlCreateEdit( "", 146, 175, 187, 18) $hInput3 = GUICtrlCreateInput( "", 146, 214, 187, 56) $hButton = GUICtrlCreateButton( "Submit", 39, 289, 107, 29) $hButton2 = GUICtrlCreateButton( "Cancel", 215, 291, 87, 24) GUISetState() While 1 $hMsg = GUIGetMsg() Switch $hMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  8. Dear Team, I am trying to develop small application to show system ip address and asset id once user click on Show button .Please help me . I have gone few forum but got different input and unable to go further please suggest . #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> $hGUI = GUICreate( "New Window", 366, 249, -1, -1) $hLabel = GUICtrlCreateLabel( "Asset ID ", 35, 42, 112, 23) GUICtrlSetFont( -1, 12, 400, 0, "Tahoma") $hLabel2 = GUICtrlCreateLabel( "Ip address ", 34, 80, 84, 21) GUICtrlSetFont( -1, 12, 400, 0, "Tahoma") $hInput = GUICtrlCreateInput( "", 124, 45, 136, 23) $hInput2 = GUICtrlCreateInput( "", 126, 85, 135, 20) $hButton = GUICtrlCreateButton( "Show", 30, 158, 117, 39) GUICtrlSetFont( -1, 10, 800, 0, "Tahoma") $hButton2 = GUICtrlCreateButton( "Cancel", 204, 161, 101, 34) GUICtrlSetFont( -1, 10, 800, 0, "Tahoma") GUISetState() While 1 $hMsg = GUIGetMsg() Switch $hMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  9. Hi Orbs, Yes its working fine if i select any path frm c:. Dont know where is going wrong
  10. Please help me anyone in this : I have to create the folder manully in the users profile and copy the required file which get created on desktop and text file which i have to select. problem when i select the text file from d: folder structure not getting created as in user profile .Same getting created where i have selected txt file . i want to create folder structure in user profile if i select text file from any drive . #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Global $hMsg Global $path Global $test Global $mserver ;get server name Global $lpwd ; Global $Email Global $var Global $usrname Global $splitsrname1 Global $hButton Global $hButton2 Global $intWindow Global $delwindow Global $hInput;Email address Global $temp Global $splitsrname $hGUI = GUICreate("Lotus Notes Auto Config", 460, 189, -1, -1) $Empid = GUICtrlCreateLabel("Enter Emp ID :", 33, 30, 140, 27) GUICtrlSetFont(-1, 10, 800, 0) $hLabel2 = GUICtrlCreateLabel("Enter Email Address :", 33, 64, 153, 27) GUICtrlSetFont(-1, 10, 800, 0) $hLabel3 = GUICtrlCreateLabel("Enter Server Name :", 33, 102, 153, 27) GUICtrlSetFont(-1, 10, 800, 0) $hInput = GUICtrlCreateInput("", 220, 30, 221, 27) $hInput2 = GUICtrlCreateInput("", 220, 64, 221, 27) $hInput3 = GUICtrlCreateInput("", 220, 102, 221, 27) $hButton = GUICtrlCreateButton("OK", 82, 146, 96, 26) GUICtrlSetFont(-1, 8.5, 800, 0) $hButton2 = GUICtrlCreateButton("Cancle", 228, 146, 98, 26) GUICtrlSetFont(-1, 8.5, 800, 0) $hLabel4 = GUICtrlCreateLabel("(Eg.inbrt01.Sgs.com)", 42, 121, 117, 13) $hLabel5 = GUICtrlCreateLabel("(Eg.first.last name@sgs.com )", 34, 85, 144, 17) GUISetState(@SW_SHOW) $usrname = GUICtrlRead($hInput) $mserver = GUICtrlRead($hInput3) $Email = GUICtrlRead($hInput2) ;$splitsrname1 = StringRight($mserver, 8) $hMsg = 0 While $hMsg <> $GUI_EVENT_CLOSE $hMsg = GUIGetMsg() Switch $hMsg Case $hButton $usrname = GUICtrlRead($hInput) $mserver = GUICtrlRead($hInput3) $Email = GUICtrlRead($hInput2) $splitsrname1 = StringRight($mserver, 8) $splitsrname = StringTrimRight($mserver, 8) $result = StringCompare(".sgs.com", $splitsrname1) $splitemname = StringRight($Email, 8) $result1 = StringCompare("@sgs.com", $splitemname) If $result <> 0 or $Empid = "" Or $Email = "" Or $mserver = "" or $result1 <>0 Then MsgBox(0, "Warning", "Please type the all inputs in correct format " & @CRLF & "TRY AGAIN ?") Else GUIDelete($delwindow) Idfile() EndIf Case $hButton2 ExitLoop EndSwitch ;GUIDelete($delwindow) WEnd Func Idfile() $hGUI1 = GUICreate("Lotus Notes Auto Config ", 394, 142, -1, -1) $hLabel1 = GUICtrlCreateLabel("Select Notes ID file ", 98, 16, 142, 27) GUICtrlSetFont(-1, 10, 800, 0) $hButton1 = GUICtrlCreateButton("Browse", 53, 92, 96, 23) GUICtrlSetFont(-1, 10, 800, 0) $hButton21 = GUICtrlCreateButton("Done", 229, 92, 95, 23) GUICtrlSetFont(-1, 8.5, 800, 0) $path = GUICtrlCreateInput("", 19, 43, 349, 27) GUISetState() $hMsg1 = 0 While $hMsg1 <> $GUI_EVENT_CLOSE $hMsg1 = GUIGetMsg() Select Case $hMsg1 = $hButton1 $var = FileOpenDialog("Browse", "C:\", "ID file (*.txt)") ;returns the file path GUICtrlSetData($path, $var) ;set input data $test = GUICtrlSetData($path,$var ) Case $hMsg1 = $hButton21 $temp= GUICtrlRead($path) ;MsgBox(1,"Input details","Id file path" & $temp) if $temp = "" then MsgBox(1,"Error ","ID File Location Cannot be blank") GUIDelete($delwindow) Idfile() Else GUIDelete($delwindow);MsgBox(1,"ID File path",($temp)) notes() EndIf ;Return EndSelect WEnd EndFunc ;==>Idfile Func notes() TrayTip(" ", "Please wait Creating config files.", 2) ;Creating config file $file = FileOpen(@DesktopDir & "\lnconfig.txt", 2) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($file, "Username=" & $usrname & @CRLF) FileWrite($file, "KeyfileName=" & $temp & @CRLF) ; The CRLF at the end is a line break FileWrite($file, "Domino.Name= "& $splitsrname & "/TCS" & @CRLF) FileWrite($file, "Domino.Address="& $mserver & @CRLF) FileWrite($file, "Domino.Port=TCPIP"& @CRLF) FileWrite($file, "Domino.Server=1"& @CRLF) FileWrite($file, "AdditionalServices=0" & @CRLF) FileWrite($file, "AdditionalServices.NetworkDial=0"& @CRLF) FileWrite($file, "Replication.Threshold=9999"& @CRLF) FileWrite($file, "Replication.Schedule=0" & @CRLF) EndIf FileClose($file) TrayTip("Lotus Notes Auto Config ", "Please wait Creating config files.", 2) ; creation of notes.ini $OS= @OSVersion if $OS ="Win_XP" Then $filen = FileOpen(@DesktopDir & "\notes.ini", 2) If $filen = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($filen, "[Notes]"&@CRLF) FileWrite($filen, "CONFIGFILE=" & @DesktopDir & "\"&"lnConfig.txt" & @CRLF) ; The CRLF at the end is a line break FileWrite($filen, "KitType=1" & @CRLF) FileWrite($filen, "Directory=" & "C:\Documents and Settings" & @username & "\Local Settings\Application Data\Lotus\Notes\Data" & @CRLF) FileWrite($filen, "Directory=" & "C:\Documents and Settings" & @username & "\Local Settings\Application Data\IBM\Notes\Data" & @CRLF) FileWrite($filen, "StackedIcons=0" & @CRLF) FileWrite($filen, "MenusAdvanced=1" & @CRLF) ;FileWrite($filen, "CacheMail=1" & @CRLF) FileWrite($filen, "ArchiveNoSchedulePrompt=1" & @CRLF) FileWrite($filen, "ArchiveNoEnablePrompt=1" & @CRLF) FileWrite($filen, "iNotes_WA_EnableActionsInArchive=1" & @CRLF) EndIf Else $filen = FileOpen(@DesktopDir & "\notes.ini", 2) If $filen = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($filen, "[Notes]"&@CRLF) FileWrite($filen, "CONFIGFILE=" & @DesktopDir & "\"&"lnConfig.txt" & @CRLF) ; The CRLF at the end is a line break FileWrite($filen, "KitType=1" & @CRLF) FileWrite($filen, "Directory=" & "C:\users\" & @username & "\AppData\Local\Lotus\Notes\Data" & @CRLF) FileWrite($filen, "Directory=" & "C:\users\" & @username & "\AppData\Local\IBM\Notes\Data" & @CRLF) FileWrite($filen, "StackedIcons=0" & @CRLF) FileWrite($filen, "MenusAdvanced=1" & @CRLF) ;FileWrite($filen, "CacheMail=1" & @CRLF) FileWrite($filen, "ArchiveNoSchedulePrompt=1" & @CRLF) FileWrite($filen, "ArchiveNoEnablePrompt=1" & @CRLF) FileWrite($filen, "iNotes_WA_EnableActionsInArchive=1" & @CRLF) TrayTip("Lotus Notes Auto Config ", "Please wait Creating config files.", 2) EndIf EndIf ; Create the Lotus->notes-> data folder in user profile $OS=@OSVersion if $OS ="Win_XP" Then Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & rename Lotus\Notes\Data Data1_Old" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & Mkdir Lotus\Notes\Data" ,"",@SW_HIDE) sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & rename IBM\Notes\Data Data1_old" ,"",@SW_HIDE) Sleep(2000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & Mkdir IBM\Notes\Data" ,"",@SW_HIDE) Sleep(2000) Else Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & rename Lotus\Notes\Data data1_old" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & MD Lotus\Notes\Data" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & rename IBM\Notes\Data Data1_old" ,"",@SW_HIDE) Sleep(2000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & MD IBM\Notes\Data" ,"",@SW_HIDE) Sleep(2000) EndIf ;Copying id file to data folder $tmp2 = MsgBox(0," ","txt file copying to DATA folder" ) Sleep(1000) TrayTip(" ", "Please wait Copying necessary files.", 2) Sleep(1000) $OS=@OSVersion if $OS ="Win_XP" Then Global $filedes1 = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\Lotus\Notes\Data\") Sleep(1000) global $filedes1x = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\IBM\Notes\Data\") Sleep(1000) fileCopy($temp,$filedes1,1) Sleep(1000) FileCopy($temp,$filedesx,1) Sleep(2000) Else global $filedes1 = ("C:\Users\" & @username & "\AppData\Local\Lotus\Notes\Data\") Sleep(1000) global $filedesx = ("C:\Users\" & @username & "\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes1,1) Sleep(1000) FileCopy($temp,$filedesx,1) Sleep(2000) EndIf $filedes2 = ("C:\Windows\System32\config\systemprofile\AppData\Local\Lotus\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes2,1) Sleep(3000) $filedes5 = ("C:\WINDOWS\system32\config\systemprofile\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes5,1) Sleep(3000) TrayTip(" ", "Please wait Copying necessary files.", 9) ;Notes.ini moving in user profile $OS=@OSVersion if $OS ="Win_XP" Then $filesrc = @DesktopDir &"\notes.ini" $filedes = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\Lotus\Notes\Data\") $filedesn = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\IBM\Notes\Data\") Sleep(1000) Filecopy($filesrc,$filedes,1) Sleep(1000) Filecopy($filesrc,$filedesn,1) Sleep(2000) Else $filesrc = @DesktopDir &"\notes.ini" $filedes = ("C:\Users\" & @username & "\AppData\Local\Lotus\Notes\Data\") $filedesn = ("C:\Users\" & @username & "\AppData\Local\IBM\Notes\Data\") Sleep(1000) Filecopy($filesrc,$filedes,1) Sleep(2000) Filecopy($filesrc,$filedesn,1) Sleep(3000) EndIf TrayTip("Lotus Notes Auto Config ", "Please wait Copying necessary files.", 9) $filesrc3 = @DesktopDir &"\notes.ini" $filedes3 = ("C:\Windows\System32\config\systemprofile\AppData\Local\Lotus\Notes\Data\") Sleep(1000) FileCopy($filesrc3,$filedes3,1) Sleep(3000) ;EndIf $filesrc4 = @DesktopDir &"\notes.ini" $filedes4 = ("C:\WINDOWS\system32\config\systemprofile\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($filesrc4,$filedes4,1) Sleep(3000) TrayTip("Lotus Notes Auto Config 8.5.2 ", "Copied all necessary files.", 2) Sleep(1000) Lotus_main() EndFunc Func Lotus_main() TrayTip(" ", "Launching the lotus notes please wait..", 10) Sleep(2000) Send("#r") WinWaitActive("Run") Send("notes.exe{Enter}") Sleep(6000) EndFunc
  11. Thanks for your reply .. Can you please help me i am unable to find out where is exact issue . I am not taking @workingDir in account . Incase user select path from d: folder is getting created in id file path itself .
  12. Hi, If i select the id file from the desktop folder .Everything work fine . Even folder also get created in user profile . Incase if i select the id file from other location i mean frm d: or from any other folder . Folder is not getting Created also its is not getting moved into the folders
  13. I have to create the Folder into the user profile after that from the input window i have taken path of text file and that has to get copy into the created user profile folders. Problem is that if i select the txt file from desktop . Folder will get create successfully in user profile and copy the txt in folders . In-case if i select the txt file path from other apart from desktop location ,folder is not getting created in user profile but its getting created in path of txt file . I need to copy the text file from any location to user profile . Please help me . here is code : Where is going wrong i am not getting please help me If i select the id file from the desktop folder .Everything work fine . Even folder also get created in user profile . Incase if i select the id file from other location i mean frm d: or from any other folder . Folder is not getting Created also its is not getting moved into the folders #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Global $hMsg Global $path Global $test Global $mserver ;get server name Global $lpwd ; Global $Email Global $var Global $usrname Global $splitsrname1 Global $hButton Global $hButton2 Global $intWindow Global $delwindow Global $hInput;Email address Global $temp Global $splitsrname $hGUI = GUICreate("Lotus Notes Auto Config", 460, 189, -1, -1) $Empid = GUICtrlCreateLabel("Enter Emp ID :", 33, 30, 140, 27) GUICtrlSetFont(-1, 10, 800, 0) $hLabel2 = GUICtrlCreateLabel("Enter Email Address :", 33, 64, 153, 27) GUICtrlSetFont(-1, 10, 800, 0) $hLabel3 = GUICtrlCreateLabel("Enter Server Name :", 33, 102, 153, 27) GUICtrlSetFont(-1, 10, 800, 0) $hInput = GUICtrlCreateInput("", 220, 30, 221, 27) $hInput2 = GUICtrlCreateInput("", 220, 64, 221, 27) $hInput3 = GUICtrlCreateInput("", 220, 102, 221, 27) $hButton = GUICtrlCreateButton("OK", 82, 146, 96, 26) GUICtrlSetFont(-1, 8.5, 800, 0) $hButton2 = GUICtrlCreateButton("Cancle", 228, 146, 98, 26) GUICtrlSetFont(-1, 8.5, 800, 0) $hLabel4 = GUICtrlCreateLabel("(Eg.inbrt01.Sgs.com)", 42, 121, 117, 13) $hLabel5 = GUICtrlCreateLabel("(Eg.first.last name@sgs.com )", 34, 85, 144, 17) GUISetState(@SW_SHOW) $usrname = GUICtrlRead($hInput) $mserver = GUICtrlRead($hInput3) $Email = GUICtrlRead($hInput2) ;$splitsrname1 = StringRight($mserver, 8) $hMsg = 0 While $hMsg <> $GUI_EVENT_CLOSE $hMsg = GUIGetMsg() Switch $hMsg Case $hButton $usrname = GUICtrlRead($hInput) $mserver = GUICtrlRead($hInput3) $Email = GUICtrlRead($hInput2) $splitsrname1 = StringRight($mserver, 8) $splitsrname = StringTrimRight($mserver, 8) $result = StringCompare(".sgs.com", $splitsrname1) $splitemname = StringRight($Email, 8) $result1 = StringCompare("@sgs.com", $splitemname) If $result <> 0 or $Empid = "" Or $Email = "" Or $mserver = "" or $result1 <>0 Then MsgBox(0, "Warning", "Please type the all inputs in correct format " & @CRLF & "TRY AGAIN ?") Else GUIDelete($delwindow) Idfile() EndIf Case $hButton2 ExitLoop EndSwitch ;GUIDelete($delwindow) WEnd Func Idfile() $hGUI1 = GUICreate("Lotus Notes Auto Config ", 394, 142, -1, -1) $hLabel1 = GUICtrlCreateLabel("Select Notes ID file ", 98, 16, 142, 27) GUICtrlSetFont(-1, 10, 800, 0) $hButton1 = GUICtrlCreateButton("Browse", 53, 92, 96, 23) GUICtrlSetFont(-1, 10, 800, 0) $hButton21 = GUICtrlCreateButton("Done", 229, 92, 95, 23) GUICtrlSetFont(-1, 8.5, 800, 0) $path = GUICtrlCreateInput("", 19, 43, 349, 27) GUISetState() $hMsg1 = 0 While $hMsg1 <> $GUI_EVENT_CLOSE $hMsg1 = GUIGetMsg() Select Case $hMsg1 = $hButton1 $var = FileOpenDialog("Browse", "C:\", "ID file (*.txt)") ;returns the file path GUICtrlSetData($path, $var) ;set input data $test = GUICtrlSetData($path,$var ) Case $hMsg1 = $hButton21 $temp= GUICtrlRead($path) ;MsgBox(1,"Input details","Id file path" & $temp) if $temp = "" then MsgBox(1,"Error ","ID File Location Cannot be blank") GUIDelete($delwindow) Idfile() Else GUIDelete($delwindow);MsgBox(1,"ID File path",($temp)) notes() EndIf ;Return EndSelect WEnd EndFunc ;==>Idfile Func notes() TrayTip(" ", "Please wait Creating config files.", 2) ;Creating config file $file = FileOpen(@DesktopDir & "\lnconfig.txt", 2) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($file, "Username=" & $usrname & @CRLF) FileWrite($file, "KeyfileName=" & $temp & @CRLF) ; The CRLF at the end is a line break FileWrite($file, "Domino.Name= "& $splitsrname & "/TCS" & @CRLF) FileWrite($file, "Domino.Address="& $mserver & @CRLF) FileWrite($file, "Domino.Port=TCPIP"& @CRLF) FileWrite($file, "Domino.Server=1"& @CRLF) FileWrite($file, "AdditionalServices=0" & @CRLF) FileWrite($file, "AdditionalServices.NetworkDial=0"& @CRLF) FileWrite($file, "Replication.Threshold=9999"& @CRLF) FileWrite($file, "Replication.Schedule=0" & @CRLF) EndIf FileClose($file) TrayTip("Lotus Notes Auto Config ", "Please wait Creating config files.", 2) ; creation of notes.ini $OS= @OSVersion if $OS ="Win_XP" Then $filen = FileOpen(@DesktopDir & "\notes.ini", 2) If $filen = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($filen, "[Notes]"&@CRLF) FileWrite($filen, "CONFIGFILE=" & @DesktopDir & "\"&"lnConfig.txt" & @CRLF) ; The CRLF at the end is a line break FileWrite($filen, "KitType=1" & @CRLF) FileWrite($filen, "Directory=" & "C:\Documents and Settings" & @username & "\Local Settings\Application Data\Lotus\Notes\Data" & @CRLF) FileWrite($filen, "Directory=" & "C:\Documents and Settings" & @username & "\Local Settings\Application Data\IBM\Notes\Data" & @CRLF) FileWrite($filen, "StackedIcons=0" & @CRLF) FileWrite($filen, "MenusAdvanced=1" & @CRLF) ;FileWrite($filen, "CacheMail=1" & @CRLF) FileWrite($filen, "ArchiveNoSchedulePrompt=1" & @CRLF) FileWrite($filen, "ArchiveNoEnablePrompt=1" & @CRLF) FileWrite($filen, "iNotes_WA_EnableActionsInArchive=1" & @CRLF) EndIf Else $filen = FileOpen(@DesktopDir & "\notes.ini", 2) If $filen = -1 Then MsgBox(0, "Error", "Unable to open file.") Else FileWrite($filen, "[Notes]"&@CRLF) FileWrite($filen, "CONFIGFILE=" & @DesktopDir & "\"&"lnConfig.txt" & @CRLF) ; The CRLF at the end is a line break FileWrite($filen, "KitType=1" & @CRLF) FileWrite($filen, "Directory=" & "C:\users\" & @username & "\AppData\Local\Lotus\Notes\Data" & @CRLF) FileWrite($filen, "Directory=" & "C:\users\" & @username & "\AppData\Local\IBM\Notes\Data" & @CRLF) FileWrite($filen, "StackedIcons=0" & @CRLF) FileWrite($filen, "MenusAdvanced=1" & @CRLF) ;FileWrite($filen, "CacheMail=1" & @CRLF) FileWrite($filen, "ArchiveNoSchedulePrompt=1" & @CRLF) FileWrite($filen, "ArchiveNoEnablePrompt=1" & @CRLF) FileWrite($filen, "iNotes_WA_EnableActionsInArchive=1" & @CRLF) TrayTip("Lotus Notes Auto Config ", "Please wait Creating config files.", 2) EndIf EndIf ; Create the Lotus->notes-> data folder in user profile $OS=@OSVersion if $OS ="Win_XP" Then Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & rename Lotus\Notes\Data Data1_Old" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & Mkdir Lotus\Notes\Data" ,"",@SW_HIDE) sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & rename IBM\Notes\Data Data1_old" ,"",@SW_HIDE) Sleep(2000) Run(@ComSpec & " /k cd %userprofile% & cd Local Settings & cd Application Data & Mkdir IBM\Notes\Data" ,"",@SW_HIDE) Sleep(2000) Else Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & rename Lotus\Notes\Data data1_old" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & MD Lotus\Notes\Data" ,"",@SW_HIDE) Sleep(1000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & rename IBM\Notes\Data Data1_old" ,"",@SW_HIDE) Sleep(2000) Run(@ComSpec & " /k cd %userprofile% & cd Appdata & cd Local & MD IBM\Notes\Data" ,"",@SW_HIDE) Sleep(2000) EndIf ;Copying id file to data folder $tmp2 = MsgBox(0," ","txt file copying to DATA folder" ) Sleep(1000) TrayTip(" ", "Please wait Copying necessary files.", 2) Sleep(1000) $OS=@OSVersion if $OS ="Win_XP" Then Global $filedes1 = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\Lotus\Notes\Data\") Sleep(1000) global $filedes1x = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\IBM\Notes\Data\") Sleep(1000) fileCopy($temp,$filedes1,1) Sleep(1000) FileCopy($temp,$filedesx,1) Sleep(2000) Else global $filedes1 = ("C:\Users\" & @username & "\AppData\Local\Lotus\Notes\Data\") Sleep(1000) global $filedesx = ("C:\Users\" & @username & "\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes1,1) Sleep(1000) FileCopy($temp,$filedesx,1) Sleep(2000) EndIf $filedes2 = ("C:\Windows\System32\config\systemprofile\AppData\Local\Lotus\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes2,1) Sleep(3000) $filedes5 = ("C:\WINDOWS\system32\config\systemprofile\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($temp,$filedes5,1) Sleep(3000) TrayTip(" ", "Please wait Copying necessary files.", 9) ;Notes.ini moving in user profile $OS=@OSVersion if $OS ="Win_XP" Then $filesrc = @DesktopDir &"\notes.ini" $filedes = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\Lotus\Notes\Data\") $filedesn = ("C:\Documents and Settings\" & @username & "\Local Settings\Application Data\IBM\Notes\Data\") Sleep(1000) Filecopy($filesrc,$filedes,1) Sleep(1000) Filecopy($filesrc,$filedesn,1) Sleep(2000) Else $filesrc = @DesktopDir &"\notes.ini" $filedes = ("C:\Users\" & @username & "\AppData\Local\Lotus\Notes\Data\") $filedesn = ("C:\Users\" & @username & "\AppData\Local\IBM\Notes\Data\") Sleep(1000) Filecopy($filesrc,$filedes,1) Sleep(2000) Filecopy($filesrc,$filedesn,1) Sleep(3000) EndIf TrayTip("Lotus Notes Auto Config ", "Please wait Copying necessary files.", 9) $filesrc3 = @DesktopDir &"\notes.ini" $filedes3 = ("C:\Windows\System32\config\systemprofile\AppData\Local\Lotus\Notes\Data\") Sleep(1000) FileCopy($filesrc3,$filedes3,1) Sleep(3000) ;EndIf $filesrc4 = @DesktopDir &"\notes.ini" $filedes4 = ("C:\WINDOWS\system32\config\systemprofile\AppData\Local\IBM\Notes\Data\") Sleep(1000) FileCopy($filesrc4,$filedes4,1) Sleep(3000) TrayTip("Lotus Notes Auto Config 8.5.2 ", "Copied all necessary files.", 2) Sleep(1000) Lotus_main() EndFunc Func Lotus_main() TrayTip(" ", "Launching the lotus notes please wait..", 10) Sleep(2000) Send("#r") WinWaitActive("Run") Send("notes.exe{Enter}") Sleep(6000) EndFunc
  14. Dear Team, I need small help, we have to wait to wait till partial title window appear then process for the next . i have used Opt('WinTitleMatchMode', 2) but no luck .. Please help me Find the below code : if any one has any optimize code please suggest the same sleep(4000) Opt('WinTitleMatchMode', 2) Global $Win = 'Design - IBM Notes', $GetTitle $GetTitle = WinGetTitle($Win) If WinWaitActive($Win) Then WinClose($Win) MsgBox(64, 'Info',"Window created") else MsgBox(64, 'Info',"Window not created") EndIf Sleep(10)
×
×
  • Create New...