Dean Banko
Dean Banko

Reputation: 7

Why shell command generates runtime error 53?

I have a sub that has to merge all txt files into one named all.txt. It should be run by pressing a button associated to this sub, but it generates the Run-time error 53 File not found. The code is this:

Private Sub CommandButton1_Click()
    Call Shell("copy c:\test\*.txt c:\test\all.txt", vbNormalFocus)
End Sub

Where is the error?

Upvotes: 0

Views: 369

Answers (1)

user14797724
user14797724

Reputation: 107

copy

Is an internal command of CMD.exe

So

CMD /C copy blah blah

See

CMD /?

Upvotes: 1

Related Questions