Sign in to follow this  
Followers 0
theguy0000

Invalid directory name?

4 posts in this topic

$AutoItDir = RegRead("HKLM\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
If @error Or Not FileExists ($AutoItDir&"\AutoIt3.exe") Then error("Could not locate AutoIt3.exe")
$run = Run ($AutoItDir&'\AutoIt3.exe /ErrorStdOut "'&$newscriptpath&'"', Default, Default, 2)

Func error ($str)
    ConsoleWrite ($str)
    Exit
EndFunc

Obviously there's more to the program than that, but that's the only significant part.

And, $newscriptpath is "C:\temp\AuCGI\control.auw"

I get "Unable to execute the external program. The directory name is invalid" for the Run line. What am I doing wrong?

Oh and I know it's reading from the registry because otherwise it would Exit before it runs, which obviously isn't happening. the InstallDir key is C:\Program Files\AutoIt3

latest version 3.2.8.1, SyntaxCheck not catching anything.


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites



Protect the path with spaces by using double quotes and it may work for you.

$AutoItDir = RegRead("HKLM\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
If @error Or Not FileExists ($AutoItDir&"\AutoIt3.exe") Then error("Could not locate AutoIt3.exe")
$run = Run ('"' & $AutoItDir&'\AutoIt3.exe" /ErrorStdOut "' & $newscriptpath & '"', Default, Default, 2)

Func error ($str)
    ConsoleWrite ($str)
    Exit
EndFunc

I am not sure about those Defaults, but that is something else as to your current issue.

:)

Share this post


Link to post
Share on other sites

You may have to set the default directory to "".

Share this post


Link to post
Share on other sites

Well, that got rid of the error...Had to do both. Still not working correctly, but that's a different problem, at least we have no more errors.

Thanks!


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

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