guysmilie Posted October 3, 2009 Share Posted October 3, 2009 (edited) How can I have one .au3 script run another .au3 script? I tried RUN and SHELLEXECUTE without success. Also what if I want to have a .au3 script launch a perl script with the .pl file extension, would this be possible? Thanks in advance to anyone who can help me, Guy. Edited October 3, 2009 by guysmilie Link to comment Share on other sites More sharing options...
Developers Jos Posted October 3, 2009 Developers Share Posted October 3, 2009 Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "C:\path\yourscript.au3"') SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Crash Posted October 3, 2009 Share Posted October 3, 2009 Why don't you compile it to .exe file first, then use the RUN command? Well, it's my style, anyway. JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
TurionAltec Posted October 3, 2009 Share Posted October 3, 2009 If I'm running on a machine with AutoIT installed, not compiling means it's easier to modify scripts, and you don't waste as much space. What's the default action for Au3 files? If it's run, then shellexecute should work. If not, set the verb to "Run". Link to comment Share on other sites More sharing options...
Mobius Posted October 3, 2009 Share Posted October 3, 2009 (edited) Also what if I want to have a .au3 script launch a perl script with the .pl file extension, would this be possible? Assuming that perl is properly installed and has its bin path in the PATH environment variable: Run('perl.exe "C:\path\yourscript.pl"') If this is not the case then: Run('"c:\perl\bin\perl.exe" "C:\path\yourscript.pl"') I would not rely on the '.pl' extension recognition of shellexecute. Alternatively you could use perl's ability to parse stdin for instructions. #cs Embedded ini, use full path to perl if perl is not fully integrated into the path envar. [PERL] ;perlpath=c:\perl\bin\perl.exe [EOI] #ce GLOBAL CONST $PERL = IniRead(@SCRIPTFULLPATH,"PERL","perlpath","perl.exe") GLOBAL $PID, $PLSCR = _ 'print "Hello '& @USERNAME &'\n";'& @LF & _ 'print "Perl ProcessId: $$\n";'& @LF & _ 'print "Perl Version: $]\n";'& @LF & _ 'print "Perl Path: $^X\n";'& @LF $PID = Run('"'$PERL'"',@WORKINGDIR,@SW_HIDE,7) IF $PID THEN StdinWrite($PID,$PLSCR) StdinWrite($PID) MsgBox(64,@SCRIPTNAME,StdoutRead($PID)) ELSE MsgBox(16,@SCRIPTNAME,"failed to execute perl!") ENDIF EXIT Lame example I know, but you get the picture. Edited October 3, 2009 by Mobius Link to comment Share on other sites More sharing options...
is3ggp Posted January 21, 2010 Share Posted January 21, 2010 (edited) I'm having trouble running a perl script that requires command line parameters through autoit. My workaround is dirty and sloppy--I open a command prompt and send keys to it to make it work. In the example below, I need to pass parameters to myscript.pl and not perl.exe:RunWait('"C:\perl\bin\perl.exe" "C:\scripts\myscript.pl"') Regardless of where I place the parameters in relation to the quotes, it doesn't seem to work. Hopefully I'm just missing something painfully easy and obvious... Edited January 21, 2010 by is3ggp Link to comment Share on other sites More sharing options...
Fire Posted January 21, 2010 Share Posted January 21, 2010 (edited) is3ggp,May be your perl script required parameter execution?Somethink likeyourscript.pl -l 2 -p 3 ?I havent any problems using this:in v5.10.0 Perl env.run("cmd.exe /c start " & "test.pl","",@SW_ENABLE)Simple Perl script:#!/usr/bin/perl no warnings; print "Enter Somethink \a\r\n"; my $a= <STDIN>; chomp($a); print qq(You enter: $a); end;Please write what parameter your Perl script required? I mean usage. Edited January 21, 2010 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
is3ggp Posted January 21, 2010 Share Posted January 21, 2010 (edited) is3ggp, May be your perl script required parameter execution?Somethink like yourscript.pl -l 2 -p 3 ? I havent any problems using this: in v5.10.0 Perl env. run("cmd.exe /c start " & "test.pl","",@SW_ENABLE) Simple Perl script: #!/usr/bin/perl no warnings; print "Enter Somethink \a\r\n"; my $a= <STDIN>; chomp($a); print qq(You enter: $a); end; Please write what parameter your Perl script required? I mean usage. Thanks for the reply. Your reply was extra useful as it forced me to review a section of code I had assumed was solid--but it wasn't. There was a bug in the way I was forming the parameters. Thanks again! Edited January 21, 2010 by is3ggp Link to comment Share on other sites More sharing options...
Fire Posted January 21, 2010 Share Posted January 21, 2010 (edited) in that case you need run it Like bewlo: run("cmd.exe /c " & "test.pl " & "path " & "version " & "type " & "outputpath " & "options","",@SW_HIDE) + You can use perl2exe too(Just compile your *.pl script to *.exe & call it from Autoit script. +After this it didnt require Perl interpreter and will run standalone. Thats all. EDIT: I saw your problem solved.I`m Happy to help to you. Edited January 21, 2010 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now