开发者

VB6 App - FileCopy Fails in Win7

We are currently in the final throes of testing our existing application before we begin the process of migrating the company over to 32-bit Windows 7 with Office 2010. One of the remaining applications was written in VB6, and is experiencing a problem when it gets to perform a filecopy action.

Currently, it writes data to a file called MIDNSPTEMP.$$$ and when finished, uses the FileCopy command to copy it to an existing file called MIDNSP.$$$, where it gives me a Permission denied error. The next line which deletes the MIDNSPTEMP.$$$ is never hit.

If I create a new开发者_开发技巧 file in the same folder manually, that works, and I can also delete a file.

Can anyone point me at why it gives me a permission denied in this situation? VB6 is not a language that I am very familiar but no-one else is available to look at this.

Thanks in advance

Martin


Windows 7 does not automatically run commands as an administrative user like it did in XP instead they are run with the least privlege. You will need to either grant less restrictive permissions to the folder where you are working or start the application as an administrator using run-as.


Are you sure that the file is not locked by another process (or by another part of your own code)? ProcessMon ( http://technet.microsoft.com/en-us/sysinternals/bb896645 ) from SysInternals is your friend. It will record ever I/O to your file along with successes and failures.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜