Jump to content

IndianSage

Active Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

IndianSage's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi, I have a specific situation: Is it possible to run autoit script/.exe as a task which in turn is automating a desktop user interactive application on windows 10 where user will not be logged in - at best I can get user locked? If so how will this work or is there any tool available to do this? I am trying z-cron task scheduler but it runs only some part also I tried windows 10 task schedule with option to allow task to run which is user interactive type but that too does not work. Looking forward to hear from you to help me out of this situation. Thanks,
  2. Once again thanks and I appreciate the support from you all who replied and otherwise. By the way I was trying this evening here and found something which above was mentioned earlier by members but myself being new, without being humble, I misunderstood the help extended and my revelation about AutoIt is this which I am sure most of you experienced in AutoIt must be knowing but I will repeat for the benefits of other like me: Problem was how to send key strokes if ControId is not there using ControlSend instead of just Send commands since I want to use scheduling of the task. I misunderstood from the help given due my newness that I must have ControId. My understanding was wrong and I now realize that out of Title, Text and ControlId, I still can send the keystrokes using ControlSend command with just having Window Title itself which works / replaces earlier used Send command. I know many of you will now know what an stupidity of ASSUMPTION! But lot of experience in the programming also did make me do such stupid mistake. Second learning was that I was always thinking I must activate window before sending any key strokes etc. command/message. I was wrong there, I realize now that with window handle (title/handle) I can still send to specific window and as part of that ControlSend it may activate or not but sending message to specific window/application window will still work and I still think/guess it will send the command to that window only which is mentioned in the $hWnd of that window! WIthout being humber I still feel it was assumption live done by novice to programmiing and I am not novice to overall programming as such though I am novice proved beyond doubt in AutoIt framework. I am so elated now that I can make my automaton program work using z-cron as far is system is at LOCKED by the user. Thanks ALL of YOU truly for being such a supportive and bearing with a NOVICE. I can now consider this as closed for now for me - Till I run into another issue and I am not thinking it will not be so- I expect I may run back to community here again with another issue in future though it will now at differnt level or area of AutoIt automation. Thanks and God Bless All Members.
  3. 1. I went thru various replies to my query on How to run Autoscript exe automation program thru scheduler. I thank you all active members for their help extended to me so far. 2. I would share my one more experience, may be some already knows it, which may be helpful to someone. It is this: I used z-cron task scheduler - it works fine and is not so expensive. It has 30 days trial and very easy to install and use. (I am no way connected to z-cron commercially - nor i have purchased it yet but inclined based on my so far as one of the options.) z-cron is scheduler and runs autoit exe program in interactive mode with even when user is LOCKED the terminal when I removed, as suggested by members above, Send commands and replaced with ControSend etc. 3. I still have, I think ,last query/issue as corollary / continuous in this thread: I am trying to automate Xbase++ application - Some places / screens there is NO way, I know, to get rid of Send e.g. - I am not able to access Menu items (I tried with WinMenuSelectItem but it did not work), I tried using winspector and autoscriptInfo but did not get any control info, its in MDIChild / Edit object only, I used recursively Child and Next object commands in AutoIt - that too do not reveal anything/handles). So I had used the Send command (now only in 2 places to get to the Report selection / Menu Item selection. But in this case Locked terminal is NOT working - user has to be logged in all the time. Can this be helped in or we have a deadend here? Thanks a lot for your support so far, I truly appreciate it.
  4. Thanks for reply and suggestion, Zedna. Using AutoItInfo tool and using Next and Child recursively finding controls technique - also we are NOT able to find the ControlID of the object. This application is XBase++ application of old time - i am not sure its due that that we are unable to find Controld. Can all data entry areas in application we can find that? In some screen there is requirement to press F2 or Esc as per this application - can it that case we can use control Id? ControlId is mandatory in ControlSend/ControlSetText etc. I know controlid can be given in many ways - all fields are in a MDChild class / object but individually they are not showing up using above 2 techniques i.e. AutoItInfo tool and recursively using CHild/Next control object finding. How I can over come this or is there workaround it? Your suggestions will be highly appreciated.
  5. Jos, Yes - there is are lots of Send("keys") commands in the script as it is trying to create a report from existing application.
  6. Hi, I am trying to run an .exe created from my autoscript .au3 script using Task Scheduler - as a task. But it is not working. I am trying this on both windows 7 and 2010. While checking online for work arounds - the autoit exe s since are of interactive type - Some other suggested to use /interactive mode with AT command but this too did not work. I tried using PsExec.exe but this too did not work. Can someone please help?
  7. I tried and my code was exactly same what you have proposed. It still gives the error mentioned above.
  8. THe problem is the following AutoIt code is giving error as mentioned. Let me reiterate: Local $oCode = DotNet_LoadVBcode( FileRead( "tst00.vb" ), "System.dll | System.Net.dll | netstandard.dll" ) Multiple dll mentioned is not working at all with pipe character (|). I get following error on run/exec: BC2017: could not find library 'System.Net.dll ?' Even though the files are there in the @scriptdir - all 3 dlls. Can you give me fix for this issue? Thanks in advance. In parallel, I am trying what you have suggested too and revert with the results.
  9. I copied both dlls suggested above in the script directory itself from windows folders. It shows following error. BC2017: could not find library 'System.Net.dll ?' How to give multiple dlls? It seems to be syntax, I guess.
  10. Below is au3 code: #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Excel.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StringConstants.au3> #include <WinAPIConv.au3> #include <DotNetAll.au3> ;-------send email using vb src code and Dll sendEmail3() Func sendEmail3() Local $oCode = DotNet_LoadVBcode( FileRead( "Class1.vb" ), "clsSendEmail.dll" ) ; You must add the "System.Windows.Forms.dll" If @error Then Return ConsoleWrite( "DotNet_LoadVBcode ERR" & @CRLF ) ; assembly because of line 1 in the VB code. Exit EndIf ConsoleWrite( "DotNet_LoadVBcode OK" & @CRLF ) ; Exit Local $iRes Local $oClsSendEmail = DotNet_CreateObject( $oCode, "Class1" ) ; $oFoo is an object of the "Foo" class in the VB code If IsObj( $oClsSendEmail ) Then $oClsSendEmail.SendEmail("my email address","my passwrod", "Testing dll with autoit...", "Hi, This is test msg...", "ToEmailAddress", "SMTPServerAddress", "" ,"587", "my email id") ; Test is a method (function) of the $oFoo object Sleep(5000) MsgBox(0,"result","Message sent") EndIf EndFunc Here is the vb.net code: Imports System.Net.Mail Imports System.Net Public Class Class1 Public myCredentials As Net.NetworkCredential Public Smtp_Server As New SmtpClient Public e_mail As New MailMessage() Public Function SendEmail(ByVal SmtpUserId As String, ByVal SmtpPswd As String, ByVal EmailSubj As String, ByVal EmailBody As String _ , ByVal EmailTo As String, ByVal IpAddr As String, ByVal EmailServer As String, ByVal Port As String, ByVal FromEmailId As String) As Integer ' Dim Smtp_Server As New SmtpClient ' Dim e_mail As New MailMessage() Smtp_Server.UseDefaultCredentials = False Smtp_Server.Credentials = New Net.NetworkCredential(SmtpUserId, SmtpPswd) Smtp_Server.Port = Port Smtp_Server.EnableSsl = True Smtp_Server.Host = IpAddr e_mail = New MailMessage() e_mail.From = New MailAddress(FromEmailId) e_mail.To.Add(EmailTo) e_mail.Subject = EmailSubj e_mail.IsBodyHtml = False e_mail.Body = EmailBody Smtp_Server.Send(e_mail) Return 0 End Function End Class I hope this will help in clarifying the matter. IN case more info is missing please do let me know. Awaiting your reply. Thanks in advance.
  11. Just would like you to consider again the following observation: This same dll works fine when called from other vb.net program and we are able to send the email however when I call it thru AutoIt wrapper code in DotNetAll.aue3 does not work and give the said error even in loading the code itself.
  12. Hi, I am using external VB.net small program which allows me to send email using outside my network. My external code is tested and is working fine from vb.net form. On first step as given in earlier my activity - I am loading vbcode - it gives error: Net.NetworkCredentials not define. I am setting up credentials in side the Dll function called sendEmail with params inputs of credentials, smpt server address etc. During loading step itself this error comes up. Using same this dll creation technique- created other dlls - I called those functions in other dlls from AutoIt script - they works fine. Can anyone help who has tried this out - calling external smtp server to send emails using vb.net. Thanks in advance.
  13. Thanks LarsJ, It worked. Truly appreciate this. Also more so since this was not in the FULL version downloaded and also showed me the example.
  14. Hi, My AutoIt script is as folllows: ;use for calling function add2NosA in dll ;Local $vNo1 = 33 ;Local $vNo2 = 11 ;use for calling function sortNos in dll Local $vNo1 = [11,7,9] Local $vNo2 = [1,3,2] ; _ArrayDisplay($vNo1, "vNo1 display") ; _ArrayDisplay($vNo2, "vNo2 display") ;Local $hWnd = DllOpen("E:\CV-Dell-1\autoit3\myComObj1.dll") Local $hWnd = ObjCreate("myComObj1.clsMath") if (@error) Then MsgBox (0, "Error", "Error1 = " & @error) Exit EndIf ;function call method - DllCall with function name ;Local $aRes = DllCall($hWnd, "int", "addNosA", "int", $vNo1, "int", $vNo2) ;Local $aRes = DllCall($hWnd, "Ptr", "sortNos", "Array", $vNo1, "Array", $vNo2) ;function call method - $hWnd.<function name> ;Local $aRes = $hWnd.add2NosA($vNo1, $vNo2) ; this works fine with ObjCreate Local $aRes = $hWnd.sortNos($vNo1, $vNo2) if (@error) Then MsgBox (0, "Error", "Error2 = " & @error) DllClose($hWnd) Exit EndIf ;use appropriate msgbox ;MsgBox(0,"Result", "Result = " & $vNo1[0]) MsgBox(0,"Result", "Result = " & $aRes) _ArrayDisplay($vNo1, "vNo1 display") _ArrayDisplay($aRes , "aRes display") DllClose($hWnd) My VB.Net - ClassLibrary - Dll - COM obj is as follows - has 2 functions - add2NosA and sortNos: <ComClass(clsMath.ClassId, clsMath.InterfaceId, clsMath.EventsId)> Public Class clsMath Public Const ClassId As String = "3A42F85E-24C8-4BAA-91B5-AE56C4683C13" Public Const InterfaceId As String = "D99D7C79-2BA7-4A33-B7BC-9B7F19FDF828" Public Const EventsId As String = "CA128AC4-580C-4112-9EAD-8D1599E3F37A" Public Sub New() MyBase.New() End Sub Public Function add2NosA(ByVal no1 As Integer, ByVal no2 As Integer) As Integer Return (no1 + no2) End Function Public Sub sortNos(ByRef no1 As Array, ByRef no2 As Array) Array.Sort(no1) no2 = no1 End Sub End Class Over all I tried various 8 options mentioned in the attached Excel file - with only 1 combination working. Overall could not make Array returned capture in AutoIt script. Can someone help please? Thanks in advance. Options-Tried-Matrix-Results.xlsx
  15. By the way I tried with Array too using ClassLibrary using Vb.net and C# both but it does not work. The other functions with VB.Net and C# returning Integers etc. worked fine. I will try now with ByRef Array and modify them in ClassLibrary function as suggested by DanyFirex above and see if I get the data back. If it works fine my main purpose of returning multiple large number of items from classlibrary function is solved then in that case. I will revert after trying it out. Thanks in the meanwhile.
×
×
  • Create New...