如何修复“Windows无法访问指定的设备、路径或文件.."什么时候重新运行程序? [英] How to fix ""Windows cannot access the specified device, path, or file.." when rerun the program?

查看:36
本文介绍了如何修复“Windows无法访问指定的设备、路径或文件.."什么时候重新运行程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我做了什么.我正在制作一个程序.如果我重新运行我的程序,就会发生错误:

I don't know what I have been done. I am making a program. If I rerun my program, an error occurred :

Windows 无法访问指定的设备、路径或文件.您可能没有访问该项目的适当权限"

"Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item"

我的程序使用 UAC 清单.我尝试不使用清单并遇到相同的错误.

My program use UAC manifest. I've tried to not use the manifest and got same error.

通过使用以管理员身份运行",我可以重新运行我的程序!

By using "Run as Administrator", I can rerun my program!

你遇到过这个问题吗?Windows 有什么问题?我应该查看我的源代码什么样的代码?

Have you ever face this problem? What's wrong with Windows? What kind of code should I look into my source code?

因为这个问题,我的程序有一个由 Windows 创建的互斥锁..lol

Because of this problem, myprogram have a mutex that created by Windows.. lol

推荐答案

您的程序正在尝试创建或打开文件.第一次以管理员身份运行程序时,它创建了它,现在该文件上的 ACL 对普通用户是只读的,对管理员是可读写的.以普通用户身份运行程序失败,并在尝试打开文件进行写入时拒绝访问.

Your program is trying to create or open a file. The first time you ran your program as admin it created it, and now the ACL on that file is read-only for regular users and read-write for admins. Running your program as regular user fails with access denied when it tries to open the file for write.

这篇关于如何修复“Windows无法访问指定的设备、路径或文件.."什么时候重新运行程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆