Member Avatar

I have a VB application that creates project folders on a network drive and I want any user who runs the application to be able to create the folders but the root folder permissions don't allow users to do anyhting besides read access. Is there a way to have the code for creating the folder to be run as administrator if i have the administrator credentials?

Recommended Answers

All 4 Replies

You do not want users to be able to create folders in areas requiring admin credentials. That would defeat the purpose of setting up access rights in the first place. The app should not have admin credentials buried in it. If folders have to be created by the users it should be in an area for which the users have been given that right.

Member Avatar

I know it defeats the purpose of having certain areas that user's should not have access to create folder in but the app itself protects against any problems/mistakes the user's could possibly cause.Instead of having the user create the folder with admin rights I've created a user account with rights to create folders. Could you provide a solution for allowing the user to create the folders given these credentials?

One way to do it would be to create an entry using the task scheduler and to specify the credentials that you want to use to run that task. Then you can create a shortcut on the desktop to trigger that task scheduler entry. I used that trick to get around a SongBird bug that brought the UAC dialog up every time I started it. The danger ther is that if the app gets corrupted by malware it could allow rogue code access to your entire system.

Member Avatar

Is there any VB code such as CreateFolderAs(username, password, pathToFolder) that I can put in place of the code to just create the folder?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.