Jump to content

Execute child Script


Recommended Posts

Hi,

I'm doing this for execute child script

Func LaunchScript( $name )
    $dir = @ScriptDir & "\" & $name;
    $param = $name & ".au3";
    return ShellExecuteWait( @AutoItExe,  $dir & "\" & $param, $dir )   
EndFunc

But when I compiled this script the @AutoItExe constant pointing to the compiled exe file ! Is it possible to launch au3 child script with a compiled script ?

And an other question how to launch au3 script from VBS, me I'm using RegRead to find the AutoIt path and launching it :

'VBS Code
Set WshShell = WScript.CreateObject("WScript.Shell")
'Recherche le path de AutoIt
Dim autoItPath
autoItPath = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt\InstallDir")
pathAut2Exe = autoItPath & "AutoIt3.exe"
WshShell.Exec( pathAut2Exe & " child.au3" )

Where's no magic function to do this ? :

'VBS code
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.MagicFunction( "pathToScript.au3" )

Thanks

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...