Hello,
I am making a small app and want to be able to perform some actions on a network drive based upon questions. I would like to be able to copy some files and folders, change the NTFS perms on them, and then open a specific text file, make some changes and save it. All of these things have NTFS permissions set for Administrator only. Since the application is to be ran by Non-Administrators I need to run the code with higher perms. I saw the impersonate command but the examples that I found were for asp.net and I didn't fully understand it. Below is a snippet of what I'm trying to run.
Public Sub GetInc() Select Case vrbProjTypeCase "C"
'Commercial
Dim fileContents As String
'File below is protected by NTFS Perms
fileContents = Format(My.Computer.FileSystem.ReadAllText("P:\ComInc.txt") + 1, "000")
vrbProjInc = fileContents
My.Computer.FileSystem.WriteAllText("P:\ComInc.txt", fileContents, False)
Case "R"
'Residential
Dim fileContents As String
'File below is protected by NTFS Perms
fileContents = Format(My.Computer.FileSystem.ReadAllText("P:\ResInc.txt") + 1, "000")
vrbProjInc = fileContents
My.Computer.FileSystem.WriteAllText("P:\ResInc.txt", fileContents, False)
Case Else
Exit Sub
End Select End Sub

How do I map a network drive in VB 2005?????
RMbean
There is no built in API with .NET to do this. There are a number of tutorials out there on how to do this. You might start with http://www.mredkj.com/vbnet/vbnetmapdrive.html.
Regards,
Patrick Baker
Microsoft Visual Basic Deployment & Designer Team
------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.