Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7920333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:10:39+00:00 2026-06-03T16:10:39+00:00

My Qt/C++/Windows program needs to be able to delete some files, if possible, without

  • 0

My Qt/C++/Windows program needs to be able to delete some files, if possible, without invoking UAC.

So, I’m checking whether the file can be written without UAC, and surprisingly enough (it’s not the case on Linux), the following line:

if (QFileInfo(targetPath + "/" + applicationFileName).isWritable()
 && QFileInfo(targetPath + "/").isWritable()) {

returns true when run without UAC validation, but.. it still fails, and the Process Monitor claims:

Date & Time:    5/9/2012 9:09:16 AM
Event Class:    File System
Operation:  CreateFile
Result: ACCESS DENIED
Path:   C:\Program Files (x86)\MyApp\MyApp.exe
TID:    4540
Duration:   0.0000278
Desired Access: Delete
Disposition:    Open
Options:    Non-Directory File, Open Reparse Point
Attributes: n/a
ShareMode:  Read, Write, Delete
AllocationSize: n/a

When invoked as Administrator, it works flawlessly..

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:10:42+00:00Added an answer on June 3, 2026 at 4:10 pm

    According to QFileInfo documentation, the permissions aren’t checked by default on Windows and you can enable/disable the checking with:

    qt_ntfs_permission_lookup++; // turn checking on
    bool isWritable = QFileInfo(targetPath + "/" + applicationFileName).isWritable()
                      && QFileInfo(targetPath + "/").isWritable();
    qt_ntfs_permission_lookup--; // turn it off again
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't really understand windows UAC... I need for my program to be able
How can you open windows program by pressing a button on web page I
I want to redirect the output of some Windows program directly to gvim basically
I have a program that, among other things, needs to be able to refresh
I'm working on a program that needs to edit some objects in an Access
I am working on a Windows utility program which communicates with some custom hardware
I'm writing a program that needs to be able to kill certain processes. The
I'm writing a small .NET program on Windows 7. One thing it needs to
I have a Windows program that needs to update itself from a server automatically.
So I am writing a program in Java that needs to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.