C# Application - Permissions

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.
sreenathsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

daniel_ballaCommented:
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!
PockyMasterCommented:
You can try impersonation while writing the shortcut.
daniel_ballaCommented:
Yes, but that supposes you have the administrator credentials on machine, which will not always be the case
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

sreenathsAuthor Commented:
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?
daniel_ballaCommented:
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.
sreenathsAuthor Commented:
How do I assign full control to the text file for all users in that PC?
daniel_ballaCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.