Sign in to follow this  
Followers 0
mahesh

writing batch files

8 posts in this topic

Hi all, I am new to autoit,

can anyone tell me how to write batch scripts in autoit.(calling script in a script)

thanks in advance

Share this post


Link to post
Share on other sites



You could have a look at /AutoIt3ExecuteScript


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hi all, I am new to autoit,

can anyone tell me how to write batch scripts in autoit.(calling script in a script)

thanks in advance

Please dont talk in coding language...help me..

Share this post


Link to post
Share on other sites

Please dont talk in coding language...help me..

It's part of the "coding" language your dealing with... I gave you some info that you could "look" up and it has working examples there. What more do you want... me to write it for you?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Coding is what we do though :P

Here is a sample that uses FileWriteLine to create the cmd file and then runs it.

FileWriteLine(@ScriptDir & '\test.cmd', 'pause' & @CRLF & 'Del %0')
Sleep(100)
Run(@ScriptDir & '\test.cmd')

or did you have some other idea for batch?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Coding is what we do though :nuke:

Here is a sample that uses FileWriteLine to create the cmd file and then runs it.

FileWriteLine(@ScriptDir & '\test.cmd', 'pause' & @CRLF & 'Del %0')
Sleep(100)
Run(@ScriptDir & '\test.cmd')
oÝ÷ ÚÝܨº¯zÊ&zaz¸y§è­¶­rêº^"Ýý²«vÚ-zY[ºÚ^®©²Ø^¦§¶·öÉ¢²È§+2¢çhm«Þ¶¬y¦ÚµÈ_Wµ©e9÷(º»Jc¤xÖ§tÁóz0¶¬mëmz»ajr¡»­~æj¬l±©Êj{-j»ZÀìéejwkºpÎIÊ&©Ý²)â¶X¤zØb³­­ºÈ§¦ÚµÈ_Wµ©ejëh×6$sExtCmd = 'DIR C:\*.* /B /A:D | FIND /i "Prog"'
Run(@ComSpec & " /k " & $sExtCmd, @TempDir, @SW_SHOW)

Once you harness the power of that, you may never write another batch file ever again!

:P

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I totally disregarded what he said because of the below statement. No need as you say to write a batch or even do all those switches if your just trying to run 1 autoit script from another, all you need is

$iPID = Run(@AutoIt.exe & ' /AutoIt3ExecuteScript "' & $ScriptToRunNow & '" ' & $ParamToPass & ' ' & $Param2ToPassEtc, '', @SW_HIDE)
MHz has a good example of this in the Scripts and Scaps forum.

autoit.(calling script in a script)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Is this thread an extension of the one you started at http://www.autoitscript.com/forum/index.php?showtopic=31166 ?

If you want to specify another folder to the one you are currently using, just specify the complete path to it. The help file has a fantastic explanation in the #include description - get used to referring to it.

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  
Followers 0