Jump to content
Sign in to follow this  
LetsAuto

AutoIt scripts IN VB2010

Recommended Posts

One way to run VBS from AutoIt is described


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-30 - Version 1.6.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

You're shooting yourself in the foot... with a full 200 round mag... and the trigger is stuck in the pressed position.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Scripting for Call using file AutoItX3.dll without dll register.

Add AutoItX3.dll in to a debug folder of project to creatting.

Sample scrit to use:

Public Class Form1
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Computer.FileSystem.FileExists(String.Concat(My.Computer.FileSystem.CurrentDirectory, "\AutoItX3.dll")) Then
            AutoItx3Lib.Run("calc.exe")
        Else
            MsgBox("Pleased add file dll into the debug folder.")
            Me.Dispose()
        End If
    End Sub
End Class

Public Class AutoItx3Lib
    Private Declare Auto Function AU3_Run Lib "AutoItx3.dll" Alias "AU3_Run" (ByVal strRun As String, ByVal strDir As String, ByVal nShowFlags As Integer) As Integer
    Public Shared Function Run(ByVal fileName As String) As Integer
        Return AU3_Run(fileName, "", 1)
    End Function
End Class

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By NSUSpray
      - file scope in AutoIt programs
      - module-private functions and variables
      - python-like import operator
      Code is 10% lighter!
      This inconspicuous wrapper complements the AutoIt language with
      preprocessor keyword #import in addition to #include similar to import in Python Python-like blocking by lines indentation (without endfunc, wend etc.) dim and const outside of functions means global and global const respectively, inside of functions means local and local const arguments of function are const by default, but with dim prefix it becomes variable short synonyms for functions as a rule using in large projects: for arrays, files and strings no “$”-prefix in variable names ; file “mylib.aup” dim bar, _bar func foo() bar = _foo() func _foo(dim str="word/number/space") _bar = Sort(Split(str, "/", @NoCount)) ; file “main.aup” #import "mylib.aup" In this example variable _bar and function _foo() are private for module mylib.aup (names begin with an underscore) and not visible in main.aup. Variable bar and function foo() will be visible with the “mylib:” prefix:
      ; file “main.aup” #import "mylib.aup" bar = foo() ; error: no bar and foo() in this scope mylib:bar = mylib:foo() ; OK: bar and foo() are public in “mylib” scope mylib:_bar = mylib:_foo() ; error: _bar and _foo() are private in “mylib” scope Sort is synonym for _ArraySort, Split is synonym for StringSplit, @NoCount is synonym for $STR_NOCOUNT.
      All synonyms
      How to use this wrapper
      Place the “plys.au3” file in the “Include” folder (C:\Program Files (x86)\AutoIt3\Include\). Make in your project folder au3-file with this content #include <plys.au3> #plys "MainFileOfMyProject.aup" ; run me!  
      Then, if you have the files module1.aup and module2.au3 with the same names ; module1.aup dim bar, _bar func foo() ; instructions ; module2.au3 global $bar func foo() ; instructions endfunc func _foo() ; instructions endfunc you can write in your program like this ; MainFileOfMyProject.aup #import "module1.aup" #import "module2.au3" module1:bar = module2:foo() ;module1:_bar = module2:_foo() ; error because _bar and _foo() are private (with underscore prefix) #import "module2.au3" ; re-importing files without "#include-once" will not lead to errors  
      You can turn off data exchange through standard input/output streams, then the shell process will not hang in memory, but then you will not be able to observe the output of your program in the output window of your development environment. You can do this by adding a line to the main file of your program
      #plys nostdio You can disable autorun of your program altogether, keeping only the generation of executable files, for example, for further compilation, adding the line to the main file of your program
      #plys norun Then you can compile the program, specifying to the compiler the resulting file main.aup.au3, if the main file of your program is called main.aup.
      File processing is pretty dumb, so bugs are possible.
      How it works
      The plys.au3 file contains the code that is run immediately after the launch of your program: files are automatically processed, after which the new AutoIt process interprets the already converted code, and the current process remains cycle to continue data exchange with the new process via standard streams. This handler replaces all #import with #include. The processed files get the extension .aup.au3 and are placed in the folder of the original script with hidden attribute.
      One more example
      TODO
      #import from "filename.aup" #import from "mylib.aup" bar = foo() ; bar and foo will be taken from the "mylib.aup" #import "filename.aup" as alias #import "mylib.aup" as ml ml:bar = ml:foo() ; bar and foo will be taken from the "mylib.aup" Optimize translation speed Download
      Current version https://github.com/NSUSpray/plys
      Old version (import only): import
    • By FrancescoDiMuro
      Good morning community!
      I am working on a script which read from a text file ( .txt ) and should import all the content in a SQLite3 DB, in order to execute some queries that should be difficult to execute on a text file.
      So, I was looking for something very very fast, because the file could be very large ( I don't know exaclty how much can became big, but I know a lot of rows, it's a log file ... )
      I found the "Import method", but I don't know If I can implement it in a query ( @jchd, it's your turn!  )
      Do you know some methods that I can implement in my script to have a very very fast import of thousands and thousands rows in a SQLite3 DB?
      Thanks a lot
      Francesco
    • By FrancescoDiMuro
      Good evening everyone
      I'm working on this little project for a week, and, what I'm trying to do could be useful for many users as well...
      I'm trying to do a "Report Generator", which reads the data that have to report from a text file (.txt) formatted with this pattern;
      Data1;Data2;Data3;Data4;Data5;;

      YES, there are 2 semi-colon at the end of the line.

      In detail, Data1 is a date/time stamp with this format: YYYY/MM/DD HH:MM:SS ;

      When the script starts, the user is prompted to choose 2 dates which I'll call as:
      Report_Date_Start; Report_Date_Start. So, the report, should cover all dates between Report_Date_Start AND Report_Date_End.

      And, already at this point, I don't know how to do the query... How can I say to the script:
      SELECT * FROM (.txt) WHERE Data1 BETWEEN Report_Date_Start AND Report_Date_End; ?

      I thought that I could do a _DateDiff, but if the difference between the two dates is months and not days, how can I do the trick?
      Should I make a Switch...Case with the _DateDiff() and see then calculate all the dates between Report_Date_Start AND Report_Date_End... But then, how can I compare the dates in the file with all the dates between Report_Date_Start AND Report_Date_End? I'm going crazy, I know...

      I've already made a "Export Tool", which exports the content of the .txt file in a .db, managed with SQLite... I mean, there I could easily do a query like I did above the thread, but, this "export", for 1080 rows, takes 28 seconds to be done. And, 1080 rows are daily rows that are added every day in the .txt file, so, in a week, the file could be easily 7000+ rows, which means that the "export" would take 3 minutes to be done... And we can go over and over...
      I'll post just for be "complete" what I've done about the export, so, maybe, someone could say how to improve it in terms of efficency...
       
      Local $aContenutoFileAuditReport = "" _FileReadToArray($sFileAudit_Report, $aContenutoFileAuditReport) If(IsArray($aContenutoFileAuditReport) And Not @error) Then Local $aContenutoFileAuditReport_Splitted = "" Local $sQuery = "" Local $hInizioConteggio = TimerInit() For $i = 1 To UBound($aContenutoFileAuditReport) - 1 $aContenutoFileAuditReport_Splitted = StringSplit($aContenutoFileAuditReport[$i], ";") $sQuery = "INSERT INTO FileDB_Report(DATESTAMP, TIMESTAMP, USER_ID, OBJECT_ID, DESCRIPTION, COMMENT) " & _ "VALUES(" & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[0]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[1]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[3]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[4]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[5]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[6]) & ");" If(_SQLite_Exec($hFileDB_Report, $sQuery) <> $SQLITE_OK) Then ConsoleWrite("Errore durante l'esecuzione della query #" & $i & @CRLF) Else ConsoleWrite("Query eseguita correttamente #" & $i & @CRLF) EndIf Next ConsoleWrite("Esportazione completata in: " & Round(TimerDiff($hInizioConteggio)/1000, 0) & " secondi") Else MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura del file nell'array." & @CRLF & "Errore: " & @error) EndIf I know that I can't do queries from a .txt file...
      [19:18] 
      I've been writing this post from 18:40 maybe...
      By the way, if @jchd or someone else could tell me if I can import a formatted .txt file in SQLite and then, do queries on the DB, I'd be very happy for that...
      About the report in PDF, I'm talking with @taietel in order to know how to create a PDF.
      I hope someone will help me
      Sorry for the "long" list of questions...
      Thank you for everything you've done for me
      I have to say that this is the community of programming language that I've loved most!
      By the way, I'll be back tomorrow in the morning ( ~ 9:15 a.m. Italian time ), so, excuse me if I can't answer before that time.
      Hope you guys have a wonderful day/night.

      Thanks again

      Francesco
    • By PINTO1927
      Hello guys, I would have the need to import into the GUICtrlCreateListView all * .txt files in a folder. The * .txt files contain all of the same formatting separated by "|", the script should go on every single file and bring me back the result in the GUICtrlCreateListView. For now I only managed to upload a single file * .txt into the GUICtrlCreateListView with this code:
      Case $Button_Find $File_txt = "\\cond\UPDATE\test.txt" Dim $Array_List _FileReadToArray($File_txt, $Array_List) $Limit_Array = UBound($Array_List) - 1 For $i = 1 To $Limit_Array $All_Box = String($Array_List[$i]) GUICtrlCreateListViewItem($All_Box, $List) Next For $i2 = 0 To _GUICtrlListView_GetColumnCount($List) _GUICtrlListView_SetColumnWidth($List, $i2, $LVSCW_AUTOSIZE_USEHEADER) Next
    • By PINTO1927
      Hello guys,
      I built a gui where a GUICtrlCreateListView with two columns is present.
      Through an "Import" button I would be able to import the contents of an .xls or .txt.
      Can you help me?
      Thank's
×
×
  • Create New...