[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# Application - Permissions

Posted on 2006-04-11
8
Medium Priority
?
258 Views
Last Modified: 2010-04-16
I have a C# application that creates a file in a particular folder (For example: C:\Test) and a shortcut in the All Users/Desktop and All Users/Start Menu. When I run this program as an administrative user it works fine but when I try to run as a normal user it gives me an exception to create a shortcut in the All Users folder. I think it has to do with permissions, but how should it be modified? The shotcut link is created using windows shell in the C# application. What I want is that if any user creates a file it should be available read/write for all users in that PC.
0
Comment
Question by:sreenaths
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:daniel_balla
ID: 16429477
Hi sreenaths,
members of Everyone do not have write permissions by default on all users directory. so I doubt you will make it write that shortcut from under a non-admin user.

Cheers!
0
 
LVL 14

Expert Comment

by:PockyMaster
ID: 16430931
You can try impersonation while writing the shortcut.
0
 
LVL 9

Expert Comment

by:daniel_balla
ID: 16431022
Yes, but that supposes you have the administrator credentials on machine, which will not always be the case
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sreenaths
ID: 16431464
Suppose User A (normal user) creates a file: C:\Test\trial.txt using a C# application, is it possible to make that file read/write for all users (admin and non-admin) in that PC.
Since members of Everyone do not have permissions is it possible to make it prompt for Admin user and password?
0
 
LVL 9

Expert Comment

by:daniel_balla
ID: 16433753
Yes and Yes. You can either prompt for admin user and impersonate, or even better, you can let the users know that an admin has to install this software and they can start it as an admin using run as.
0
 

Author Comment

by:sreenaths
ID: 16435905
How do I assign full control to the text file for all users in that PC?
0
 
LVL 9

Accepted Solution

by:
daniel_balla earned 150 total points
ID: 16436604
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question