473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.FileSystem.CreateDirectory 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 1145
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.WindowsImpersonationCont ext 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.FileSystem.CreateDirectory 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**************@TK2MSFTNGP03.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
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...
6
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...
5
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...
3
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...
5
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...
7
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...
1
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...
6
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.