troubleshooting Question

The file is in use by another process after reading a directory

Avatar of JB493
JB493 asked on
Visual Basic.NET
1 Comment1 Solution223 ViewsLast Modified:
I am using the following code to find files in a directory and attach them to an email. It finds the file and attaches them as it is supposed to. when I try to then move them to a history folder I get the message "the file is in use by another process."  I have tried everything I can think of to release the resources but it doesn't seem to help.

For Each foundFile As String In My.Computer.FileSystem.GetFiles _
(My.Computer.FileSystem.SpecialDirectories.MyDocuments)
  Next
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros