-
November 29th, 2012, 08:07 AM
#1
UAC issues and permissions
Hi,
I have an application that I wrote with VB.Net 2008
This application needs to use drag and drop, File IO actions.
Lately I noticed a problem with it when the UAC (User Access Control) is turn on (On its default mode)
I use to copy a file to a folder that I create at:
Code:
System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
But when I want to delete this file I get an error about access is denied.
I try to run the application as administrator and this actually solve the issue but then the drag and drop not working.
Can someone help me to find a solution for each problem:
- How to avoid such of access denied issues.
- If run as administer why the drag and drop not working?
thanks
-
December 1st, 2012, 11:44 PM
#2
Re: UAC issues and permissions
-
December 2nd, 2012, 01:12 AM
#3
Re: UAC issues and permissions
What do you think SpecialFolder. means? You could search on Microsoft's site for the formal definition, but, it isn't complicated. You can't delete files that you don't own...
-
December 2nd, 2012, 02:04 AM
#4
Re: UAC issues and permissions
Thanks, OK
Which folder \location you suggest i will use in order to be able deleting files?
Thanks, OK
Which folder \location you suggest i will use in order to be able deleting files?
I checked it with few locations and its always act the same so i guess i cannot delete the files i want to. let me explain what my application do:
- Open from file or Drag and drop a PDF file to my application
- I save the given PDF in to a temp location
- The application use 3rd application to convert the PDF in to images for each page
- My application save these images in a database
- Now i need to delete all the images and the PDF from the temp location
Now i must clear this temp folder from all the files that i don’t need any more how can i do that?
If i run as admin i will lose the drag and drop option.
How can i do that right?
Last edited by leeshadmi; December 2nd, 2012 at 04:34 AM.
-
December 2nd, 2012, 07:04 AM
#5
Re: UAC issues and permissions
add a manifest to your software where you stated admins right si required. This will bring out the "confirm you want the software do this", and in case user has not, it would ask for Admin pwd.
ie: http://msdn.microsoft.com/en-us/library/bb756929.aspx
and http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
December 2nd, 2012, 12:35 PM
#6
Re: UAC issues and permissions
Thanks but i already try that and it works with the delete file process but then the drag and drop will not work.
I read about this issue on the net and i understood that its because the files comes from not admin application (Windows explorer) and my application run as admin and thats why the "Run as " option for my application is not good for me.
Maybe the solution will be another application that just delete the folder and run as admin, i dont know i just dont like this idea.
Isnt any other way to make my application to be able to delete files? maybe some folder that have no security on it some where in the drive?
-
December 2nd, 2012, 02:55 PM
#7
Re: UAC issues and permissions
Is it a click once application? You could try with isolated storage (ie: http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx ) but that would make hidden to you too the exact location of those files on machine...
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|