Create directory

  • Thread starter Thread starter Christian Havel
  • Start date Start date
C

Christian Havel

Hi,

how can I create a directory in the "documents and settings / user" directory?

Christian
 
Christian,

Assuming you have the rights to do so (if you are another user, and and
not an administrator) you won't, not unless you impersonate a user that has
rights and perform the operation under that user.

But generally, to create a new directory, you can use the DirectoryInfo
class, calling the Create or CreateSubDirectory methods to create the
directory that you wish.
 
Hi Nicholas,

thanks for your response!
How the directory can be created else (if the user does not have
administrator rights)? Is this a job for the install-program?

Christian

Nicholas Paldino said:
Christian,

Assuming you have the rights to do so (if you are another user, and and
not an administrator) you won't, not unless you impersonate a user that has
rights and perform the operation under that user.

But generally, to create a new directory, you can use the DirectoryInfo
class, calling the Create or CreateSubDirectory methods to create the
directory that you wish.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Christian Havel said:
Hi,

how can I create a directory in the "documents and settings / user"
directory?

Christian
 
Christian,

Well, it depends on what the directory is for. But yes, if it is a
regular user, then they will not have rights to write to the Program Files
directory.

What is the purpose of the directory that you are trying to create?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Christian Havel said:
Hi Nicholas,

thanks for your response!
How the directory can be created else (if the user does not have
administrator rights)? Is this a job for the install-program?

Christian

Nicholas Paldino said:
Christian,

Assuming you have the rights to do so (if you are another user, and
and
not an administrator) you won't, not unless you impersonate a user that
has
rights and perform the operation under that user.

But generally, to create a new directory, you can use the
DirectoryInfo
class, calling the Create or CreateSubDirectory methods to create the
directory that you wish.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Christian Havel said:
Hi,

how can I create a directory in the "documents and settings / user"
directory?

Christian
 
Hi Nicholas,

in the directory I want to save some projectinformations (creatorname, date
of creation, ...) in a Xml-file.
Christian

Nicholas Paldino said:
Christian,

Well, it depends on what the directory is for. But yes, if it is a
regular user, then they will not have rights to write to the Program Files
directory.

What is the purpose of the directory that you are trying to create?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Christian Havel said:
Hi Nicholas,

thanks for your response!
How the directory can be created else (if the user does not have
administrator rights)? Is this a job for the install-program?

Christian

Nicholas Paldino said:
Christian,

Assuming you have the rights to do so (if you are another user, and
and
not an administrator) you won't, not unless you impersonate a user that
has
rights and perform the operation under that user.

But generally, to create a new directory, you can use the
DirectoryInfo
class, calling the Create or CreateSubDirectory methods to create the
directory that you wish.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

message Hi,

how can I create a directory in the "documents and settings / user"
directory?

Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top