Click here to Skip to main content
15,917,652 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHOw I can find a sent mail with vba? Pin
Member 1199849020-Sep-15 13:21
Member 1199849020-Sep-15 13:21 
AnswerRe: HOw I can find a sent mail with vba? Pin
Dave Kreskowiak25-Sep-15 14:56
mveDave Kreskowiak25-Sep-15 14:56 
QuestionCan radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 3:55
Member 1199784020-Sep-15 3:55 
SuggestionRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:32
mveMaciej Los20-Sep-15 5:32 
GeneralRe: Can radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 5:46
Member 1199784020-Sep-15 5:46 
GeneralRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:59
mveMaciej Los20-Sep-15 5:59 
QuestionNavigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 0:29
GeekyGirlPanacea17-Sep-15 0:29 
AnswerRe: Navigating folders in listview. Pin
Brisingr Aerowing17-Sep-15 0:48
professionalBrisingr Aerowing17-Sep-15 0:48 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 1:02
GeekyGirlPanacea17-Sep-15 1:02 
AnswerRe: Navigating folders in listview. Pin
Richard MacCutchan17-Sep-15 0:51
mveRichard MacCutchan17-Sep-15 0:51 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 1:04
GeekyGirlPanacea17-Sep-15 1:04 
GeneralRe: Navigating folders in listview. Pin
Richard MacCutchan17-Sep-15 1:21
mveRichard MacCutchan17-Sep-15 1:21 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 16:17
GeekyGirlPanacea17-Sep-15 16:17 
QuestionVisual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Member 1186689316-Sep-15 7:15
Member 1186689316-Sep-15 7:15 
I need to create a tool that will recursively take ownership of a folder for our helpdesk team, we logon with admin tokens to perform administrative tasks so anyone who uses this tool will only be IT personnel and will have local admin rights when they logon with their token. Users are losing data because of corrupt file synchronization. The only way we can retrieve it is to take ownership of the c:\windows\csc and its contents. This is a very short explanation of why I need a tool, the story is much longer but this lays out why I started this project. I am new to visual basic and programming.

I wrote a program that will allow you to browse to the folder you want to take ownership of but I can't figure how get all the subdirectories. Can someone please help me make this program work recursively?

Here is the main part of the code and this will take ownership on the parent directory eg. c:\test:

#End Region
Private Sub bnBrowseFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnBrowseFolder.Click

If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
Me.folderName.Text = FolderBrowserDialog1.SelectedPath

End If
End Sub
Private Sub bnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnQuit.Click
Me.Close()
End Sub

Private Sub bnDoit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnDoit.Click

If tbUserName.Text = "" Then
MsgBox("Please type your NMEA account name (eg. Domain\adminaccountname)", MsgBoxStyle.Exclamation)
Exit Sub
End If
strPath = folderName.Text
For Each Folder In IO.Directory.GetDirectories(strPath, "*", IO.SearchOption.AllDirectories)
Next

strPath = folderName.Text
strUser = tbUserName.Text

Try
ChangeOwner(strPath, strUser)
Catch ex As Exception
MsgBox("Error: " & ex.Message, MsgBoxStyle.Critical)
End Try
MsgBox("Done!")
End Sub
AnswerRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Wendelius16-Sep-15 7:44
mentorWendelius16-Sep-15 7:44 
GeneralRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Member 1186689316-Sep-15 7:58
Member 1186689316-Sep-15 7:58 
GeneralRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Wendelius16-Sep-15 8:53
mentorWendelius16-Sep-15 8:53 
GeneralRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Member 1186689316-Sep-15 10:10
Member 1186689316-Sep-15 10:10 
AnswerRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Wendelius16-Sep-15 17:05
mentorWendelius16-Sep-15 17:05 
GeneralRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Member 1186689317-Sep-15 11:13
Member 1186689317-Sep-15 11:13 
GeneralRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Wendelius18-Sep-15 22:47
mentorWendelius18-Sep-15 22:47 
QuestionAutorun vb program from removable device Pin
Otekpo Emmanuel14-Sep-15 1:34
Otekpo Emmanuel14-Sep-15 1:34 
AnswerRe: Autorun vb program from removable device Pin
Brisingr Aerowing14-Sep-15 2:00
professionalBrisingr Aerowing14-Sep-15 2:00 
AnswerRe: Autorun vb program from removable device Pin
Dave Kreskowiak14-Sep-15 2:25
mveDave Kreskowiak14-Sep-15 2:25 
AnswerRe: Autorun vb program from removable device Pin
Tim Carmichael14-Sep-15 2:31
Tim Carmichael14-Sep-15 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.