473,809 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating Folders and Security

Hi
On the company server, there is a folder for each client. This folder should
be named after the Clients 6 digiit ID.
At the moment, the folders are created manually by users. Of course, this
leads to errors.
So I'd like to write a program that creates the folder. Just use
My.Computer.Fil eSystem.CreateD irectory will work fine, except for one issue.
I want to change the permissions on the server so that users can't create
folders manually. This also means the program won't work.
Is there something in VB that I have the program use admin permissions, so
that it will create the folder irrespective of the users rights?

Thanks
Vayse
Aug 25 '06 #1
2 1174
You can't override the security mechanisms of Windows, but, you can use
impersonation with an account with sufficient permissions to create the
directories.

Look into the System.Security .Principal.Wind owsImpersonatio nContext class.
There are a ton of example online.

Jared

"Vayse" wrote:
Hi
On the company server, there is a folder for each client. This folder should
be named after the Clients 6 digiit ID.
At the moment, the folders are created manually by users. Of course, this
leads to errors.
So I'd like to write a program that creates the folder. Just use
My.Computer.Fil eSystem.CreateD irectory will work fine, except for one issue.
I want to change the permissions on the server so that users can't create
folders manually. This also means the program won't work.
Is there something in VB that I have the program use admin permissions, so
that it will create the folder irrespective of the users rights?

Thanks
Vayse
Aug 25 '06 #2
"Vayse" <va***@deadspam .comwrote in
news:O9******** ******@TK2MSFTN GP03.phx.gbl:
Is there something in VB that I have the program use admin
permissions, so that it will create the folder irrespective of the
users rights?
Use impersonation to impersonate an admin account to set the folder
security.
Aug 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1991
by: pepericou | last post by:
I'm trying to developp an application which use Zope and DCOracle2 module to access Oracle database. I've install the DCOracle2 product on Windows XP, but when I create a python function to access my database, I' have the following error when I test it : import DCOracle2 is unauthorized Can You help me ? Thank you
6
3673
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a part of the path "D:\". My site is hosted on a public ISP that for obvious security reasons does not allow my read access above my wwwroot folder which seems to be a problem when trying to create directories... Is there any way to solve this?
5
2051
by: Markus Hopfenspirger | last post by:
Hello, I want to call a Command like winpop add username@domainname /createuser: password From a normal .Net Windows Application this is working without a problem. The same code called from a ASP Net Application or a Windows Service Application is not executed. Also if I do an impersonation to a local admin account before executing the Code.
3
1478
by: Stelrad Doulton | last post by:
Hi, I am having a strange problem on IIS 6.0. I am trying to create directories under a virtual directory on the fly to which I will upload files and retrieve these files later. I am having 2 problems: 1. I am using the code below to create a directory:
5
3431
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok afterwards. I did no development for a couple of weeks, came back and I kept receiving Access Denied to Microsoft.Net\Temporary Internet Files\... Access is Denied. ASPNET had full access to that file and all subfolders. The website I am...
7
4095
by: Zeb | last post by:
Hi all I've developed a shopping cart in C# and to allow moderators to upload product images, news images and downloadable PDFs, the app creates a folder for each product. I start out with the following empty folders: /img/products/ /img/news/ /pdf/
1
1318
by: Mick Walker | last post by:
Hi all, I am wondering is it possible to create a physical Directory such as "C:\Test" using the DirectoryServices namespace. If so, does anyone have any resources on how to do it? I should also mention, I am required to create the physical directory on any machine within the current AD domain. Kind Regards
6
2035
by: Pep | last post by:
Firstly, I'm not sure if this is the right group for this query, so please forgive me if I am wrong. My problem is that most users I distribute my software to cannot install it on their systems due to not having the correct administrator rights. I'm perplexed over this as I cannot reasonably ask corporations to allow the local secretary to have admin or power user rights just to install my software. My software is intended for user...
1
2743
by: =?Utf-8?B?YW5raXQuc3Jp?= | last post by:
How can we Create or Delete a File on a Virtual Directory from asp.net ? The situation is I want the Application to Read and Write a Certain File on Virtual directory and when I do it from File Stream it gives me an error saying Access Denied and I cannot add the IIS_WPG User to the Permission group to that Directory as that would not be a best way to do as it would void the security parameters, is there a solution or recomendations on...
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.