Jump to content



Photo

How to call AutoitX3 dll from batch file?


  • Please log in to reply
15 replies to this topic

#1 CyberMax

CyberMax

    Seeker

  • Active Members
  • 10 posts

Posted 20 November 2010 - 09:16 PM

Can anyone help me by showing me how's its done calling autoitx3 dll function from a batch file? Maybe I didnt search enough but I cant find any example of it. :(

Thanks. :graduated:





#2 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 20 November 2010 - 11:42 PM

You can't. AutoItX is a dll.

You could instead consider converting your batch file to an AutoIt script and then just call the functions directly.

#3 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,186 posts

Posted 21 November 2010 - 01:11 PM

Considering the organization of AutoItX3 this can be achieved by adding one small wrapper function to it that it would additionally export. You could then use rundll32.exe to call functions you want. Something like:
rundll32.exe AutoItX3.dll,BatchCall CDTray,D:,open

...or whatever the syntax is.

Make a feature request if you are really interested.

eMyvnE


#4 CyberMax

CyberMax

    Seeker

  • Active Members
  • 10 posts

Posted 21 November 2010 - 03:27 PM

Can this tool below, be able to call the autoitx3.dll?
http://www.softpedia.com/get/Programming/Other-Programming-Files/CallDLL-OL.shtml

#5 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 21 November 2010 - 05:24 PM

Probably. What is it you are trying to do anyway?

#6 CyberMax

CyberMax

    Seeker

  • Active Members
  • 10 posts

Posted 21 November 2010 - 05:56 PM

Probably. What is it you are trying to do anyway?

Simple, I just wanted to know whether I can call AutoitX3 dll from a batch file.
I can write simple autoit script already. But now this is a crazy idea of me whether its possible
to do it in a batch file using AutoitX3 dll file. :graduated:
Once awhile, people come up with crazy ideas and I'm one of them. :(

Edited by CyberMax, 21 November 2010 - 05:56 PM.


#7 Jos

Jos

    oh joy ...

  • Developers
  • 21,047 posts

Posted 21 November 2010 - 08:58 PM

Simple, I just wanted to know whether I can call AutoitX3 dll from a batch file.
I can write simple autoit script already. But now this is a crazy idea of me whether its possible
to do it in a batch file using AutoitX3 dll file. :graduated:
Once awhile, people come up with crazy ideas and I'm one of them. :(

That only explains what you are trying to do, not what you are trying to accomplish!
Why would you want a wrapper for autoitx3.dll when you have autoit3.exe?

Jos

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#8 CyberMax

CyberMax

    Seeker

  • Active Members
  • 10 posts

Posted 22 November 2010 - 04:51 PM

That only explains what you are trying to do, not what you are trying to accomplish!
Why would you want a wrapper for autoitx3.dll when you have autoit3.exe?

Jos


This is just the beginning, I'm trying to read an ini file by using autoitx3.dll in
a batch file. The reason is simple, since I already know its easy to use autoit to do
it but now I want to use autoitx3.dll in a batch file to do the same thing.I read in
autox future, someone already created a autoit dll wrapper for delphi, so why not create a autoit dll wrapper to be
use in a batch file, and if its really possible to do it? :graduated:

Edited by CyberMax, 22 November 2010 - 04:53 PM.


#9 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 22 November 2010 - 05:03 PM

Even if you read the value, what would you do with it? Batch files don't have things like variables.

#10 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,797 posts

Posted 23 November 2010 - 01:41 AM

Even if you read the value, what would you do with it? Batch files don't have things like variables.

Batch files do have variables.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#11 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 November 2010 - 05:18 AM

@CyberMax
You're trying to hammer a nail with a Twinkie. Just stop. Reconsider your purpose and choose a more suitable tool.

#12 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 23 November 2010 - 03:18 PM

Batch files do have variables.

How? All I knew about were environment variables (which are not batch variables and would be problematic in scope) and parameters (which are not assignable).

#13 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 November 2010 - 04:25 PM

Batch considers this a variable:
set _var=value echo %_var%

In reality it is an environment variable, but it is in local scope to the script. So you just have to be careful how you name your variables that they don't collide with the existing environment.

#14 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 23 November 2010 - 05:47 PM

But I hope you agree with me that trying to call IniRead and store it in a batch "variable" is senseless when AutoIt is made for things like that.

#15 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 November 2010 - 05:55 PM

"Tell him about the Twinkie..."

#16 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,797 posts

Posted 23 November 2010 - 08:44 PM

But I hope you agree with me that trying to call IniRead and store it in a batch "variable" is senseless when AutoIt is made for things like that.

That I would agree with. He's basically trying to use a hammer when a screwdriver is needed.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users