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

  • SEARCH
  • Home
  • 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 8652573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:20:18+00:00 2026-06-12T14:20:18+00:00

I have a program that the user can save the output session to a

  • 0

I have a program that the user can save the output session to a text file. This works fine, but when I try to save the file to a location such as C:\, it shows an error dialog saying:

You don't have permission to save to this location. Contact the administrator to obtain permission. Would you like to save to the Documents folder instead?

When I click no, thinking it would just cancel the operation, my application crashes.
I do not want my application to require administrative privileges, but how, when attempting to save the file, do I ask the user to provide privileges (such as bring up the UAC dialog, and if required provide authentication). If the user cannot provide the permissions I would like to just stay on the Save File Dialog until the user either picks a location they have permission to save to, or presses cancel. I do not really want the permission to be asked for when the program starts, just when the user saves the file to a location they need permission for.

By the way I am currently logged in as administrator when running my application, it’s the only account on my computer running Windows Vista.

  • 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-12T14:20:19+00:00Added an answer on June 12, 2026 at 2:20 pm

    Applications elevate only at startup. To simulate “getting UAC privs while running and only if needed” you actually need to partition your app so that it launches a second process (for example, to write to the file) and this process might be launched elevated. You can do this, but it’s a lot of work for little or no benefit.

    The whole point of UAC is to change the way users and applications treat the hard drive. The root of C is not a smart place to write things. Use AppData, or Documents, or create your own folder like C:\MySpecialApp (add the path to a config file) and write there. If you insist on writing to the root of C, then you require admin privs which doesn’t make much sense.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which has a text box that the user can edit.
I have done one program that allow user can listen to the music via
I have a program that loads lines from a user file, then selects the
I have a code that creates file(s) in user-specified directory. User can point to
I have a program that allows the user to enter a level number, and
I have a Win32 C++ program that validates user input and updates the UI
I develop a Python-based drawing program, Whyteboard . I have tools that the user
I have program that requires Python 3, but I develop Django and it uses
I am making a small program that reads a text file and stores it
I have a program that uses System.DirectoryServices.AccountManagement.PrincipalContext to verify that the information a user

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.