Jump to content

Trouble with 'RUN' command


Recommended Posts

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?

Link to comment
Share on other sites

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")
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...