Jump to content
Sign in to follow this  
PabloSan

Trouble with 'RUN' command

Recommended Posts

PabloSan

Hello,

Has anyone had trouble using the "RUN" command from within VBA? I have just installed v3.3.0.0 from v3.2.1.8. I have VBA code that ran in the previous version that does not run now.

Public Sub Test()
  Dim aiApp as AutoITX3Lib.AutoITX3

  Set aiApp = New AutoITX3Lib.AutoITX3
    Call aiapp.Run("C:\Apps\GetFileList.exe "C:\TestFolder" "C:\OutputFile.txt","C:\Apps")
    Call aiapp.Run("C:\Apps\GetFileList.exe "\\Server\Share\TestFolder" "C:\OutputFile.txt","C:\Apps")
  Set aiApp = Nothing
End Sub

GetFileList is a program that recursively lists filenames to the "OutputFile.txt" file.

I have access and rights to the "\\Server\Share" drive

The first Run Command executes fine. The second one puts a 1 in the aiApp.error property.

This code has worked fine in v3.2.1.8. Does anyone have any suggestions?

Share this post


Link to post
Share on other sites
Richard Robertson

The quotes aren't even, I don't see how it could have ever run.

Share this post


Link to post
Share on other sites
PabloSan

If it was that simple, I would have found the problem. I just retyped it quick so you could understand easier. It seems that the trouble comes when I try to access a network drive. I can copy the string to a CMD prompt and it runs fine. I just can't run it from inside a VBA program. Has something changed recently with the Run command?

SourceFolder=chr$(34) & "\\Server\Share\TestFolder" & chr$(34)
OutputFileName="C:\OutputFile.txt"
Call aiApp.Run("C:\Apps\GetFileList.exe " & SourceFolder & " " & OutputFileName,"C:\Apps")

Share this post


Link to post
Share on other sites
Richard Robertson

The only major change of the dll was that the string handling was changed to unicode.

I'm not sure what might have changed, this may be a problem for a developer.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.