r/visualbasic • u/shiznewski • Apr 25 '23
FileCopy - copying file to a different drive then the exe is running from
If i have my vb.net program on C: and try to copy a file from C to the Z drive (network share) it works, but the file on the Z is unable to be renamed, deleted, moved etc. it always says it is in use.
If i move the exe to the Z drive and then try to copy the same from from C to the Z drive it works fine, and the new file can be renamed, deleted etc.
How can i fix this so that the exe can be run on the users local computer and copy files to the network?
2
Upvotes
1
u/shiznewski Apr 25 '23
Nope. And i have tried everything garbage collection etc. i have literally even use that specific line of code in its own button with hardcoded source and destination for the files. It appears to be some issue with running the exe from the shared drive but i don’t see why
1
u/jd31068 Apr 25 '23
Are you manually copying it or via some code?
1
u/RJPisscat Apr 25 '23
>>the file on the Z is unable to be renamed, deleted, moved
By your application, or using File Explorer?