Jump to content
Sign in to follow this  
Marjij

Running an uncompiled script from another script

Recommended Posts

Marjij

Is this possible? If so why doesn't this work?

I have a compiled script that is run by task scheduler which simply closes an open program and then runs this command, which resets and restarts but the new script doesn't start.

It's not compiled because I still make changes periodically for improvement.

Is it not possible to run an un-compiled (.au3) script from within another script?

Run ("C:\Documents and Settings\UserName\Desktop\Script 1.26.au3", "C:\Documents and Settings\UserName\Desktop\")

Thanks

Share this post


Link to post
Share on other sites
Marjij

FAQ for the win:

RunWait(@COMSPEC & " /c Start C:\Docume~1\UserName\Desktop\UserNa~1.au3")

Share this post


Link to post
Share on other sites
Danny35d

Search the help file for /AutoIt3ExecuteScript

Run(@AutoItExe & ' /AutoIt3ExecuteScript C:\Docume~1\UserName\Desktop\UserNa~1.au3')

NOTE: Correct usage of single- and double- quotation marks is important, even double single.


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites
Mobius

You can also do something like this if executing via AutoIt3.exe.

$Rv = RunWait('"'& @AUTOITEXE &'" "'& @USERPROFILEDIR &'\Desktop\Script 1.26.au3"')
ConsoleWrite("Au3 closed with an exit value of: "& $Rv & @LF)

Using the afore mentioned quotation styles.

Vlad

Share this post


Link to post
Share on other sites
herewasplato

@Marjij,

Welcome to the forum.

FAQ for the win:

RunWait(@COMSPEC & " /c Start C:\Docume~1\UserName\Desktop\UserNa~1.au3")

I see that you found one of many ways to do this, but since it is an AU3 file, I think that #Include is the simplest method:

#Include "C:\Documents and Settings\UserName\Desktop\Script 1.26.au3"

You don't have to worry about double or single quotation marks and it handles the spaces in the path :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×