VB6 应用程序 - Win7 中文件复制失败

发布于 2024-12-04 07:16:52 字数 345 浏览 3 评论 0原文

在开始将公司迁移到包含 Office 2010 的 32 位 Windows 7 之前,我们目前正处于测试现有应用程序的最后阶段。 其余应用程序之一是用 VB6 编写的,在执行文件复制操作时遇到问题。
目前,它将数据写入名为 MIDNSPTEMP.$$$ 的文件,完成后,使用 FileCopy 命令将其复制到名为 MIDNSP.$$$ 的现有文件,在该文件中它给我一个权限被拒绝的错误。删除 MIDNSPTEMP 的下一行永远不会被命中。
如果我在同一文件夹中手动创建一个新文件,那就可以了,而且我还可以删除文件。
谁能指出我为什么在这种情况下会拒绝我的许可? VB6 不是一种我很熟悉的语言,但没有其他人可以看这个。
提前致谢
马丁

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

机场等船 2024-12-11 07:16:52

Windows 7 不会像 XP 那样以管理用户身份自动运行命令,而是以最低权限运行。您需要向您正在工作的文件夹授予较少限制的权限,或者使用 run-as 以管理员身份启动应用程序。

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.

九局 2024-12-11 07:16:52

您确定该文件没有被另一个进程(或您自己代码的另一部分)锁定吗? ProcessMon (http://technet.microsoft.com/en-us/sysinternals/bb896645 ) 是您的朋友。它将记录所有 I/O 到您的文件以及成功和失败。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文