Click here to Skip to main content

Visual Basic

 
GeneralRe: Timer for Internet connection PinmvpDave Kreskowiak21-Dec-12 5:11 
Questioninstr function not accepting arguments VB.net Pinmemberxman12519-Dec-12 3:10 
AnswerRe: instr function not accepting arguments VB.net PinmvpDave Kreskowiak19-Dec-12 4:13 
AnswerRe: instr function not accepting arguments VB.net PinmemberZaf Khan19-Dec-12 6:37 
GeneralRe: instr function not accepting arguments VB.net Pinmemberxman12519-Dec-12 21:44 
GeneralRe: instr function not accepting arguments VB.net Pinmemberxman12519-Dec-12 21:50 
GeneralRe: instr function not accepting arguments VB.net PinmemberZaf Khan19-Dec-12 22:05 
AnswerRe: instr function not accepting arguments VB.net PinmemberEddy Vluggen20-Dec-12 2:56 
QuestionRe: instr function not accepting arguments VB.net PinmemberZaf Khan19-Dec-12 22:02 
GeneralRe: instr function not accepting arguments VB.net PinmvpDave Kreskowiak20-Dec-12 2:47 
AnswerRe: instr function not accepting arguments VB.net PinmemberMike Meinz23-Jan-13 4:36 
QuestionIs it possible to change Import directives dynamically at run time. [modified] PinmemberMember 342716218-Dec-12 11:32 
AnswerRe: Is it possible to change Import directives dynamically at run time. PinmemberEddy Vluggen18-Dec-12 22:57 
Questionconcatenate 2 scripts PinmemberNitro7617-Dec-12 3:54 
Hello all,

I made 2 scripts under, the first for search all folders and subfolders (named "prive") in my R: Drive and the second for search security groups(begin by FR_DEPT ou LTGFR) on a folder.
I want to concatenate scripts for each "prive" folder, it could search if groups are affected.
Can you help me please?
Thanks in advance

'------------------------------------- 1er script

Option Explicit

Dim path_start
Dim subfolder
Dim Myfso, result
Set Myfso = CreateObject("Scripting.FileSystemObject")

path_start = "R:"
subfolder = "prive"

result = Find(path_start, subfolder)



Function Find (strPath, strFileName)
Dim MyDir, MyFile, MySubDir
Dim strResult

If strFileName = Empty Then Exit Function
strFileName = Ucase(strFileName)

Set MyDir = Myfso.GetFolder(strPath)

For Each MyFile In MyDir.subFolders
If Ucase(MyFile.Name) = strFileName Then strResult = strResult & strPath & "\" & MyFile.Name & vbCrLf
Next

For Each MySubDir In MyDir.SubFolders
strResult = strResult & Find(strPath & "\" & MySubDir.Name, strFileName)
Next

Find = strResult

End Function

'---------------------------------- 2eme script





strFolderName = "Le dossier prive de mon 1er script"
Const INPUT1_FILE_NAME = "c:\test1.txt"

Const FOR_READING = 1, FOR_WRITING = 2, FOR_APPEND = 8


Const OVER_WRITE_EXISTING = True
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(INPUT1_FILE_NAME, FOR_APPEND,true)



Set objWMIService = GetObject("winmgmts:")
Set objFolderSecuritySettings = _
objWMIService.Get("Win32_LogicalFileSecuritySetting='" & strFolderName & "'")
intRetVal = objFolderSecuritySettings.GetSecurityDescriptor(objSD)

intControlFlags = objSD.ControlFlags

arrACEs = objSD.DACL



For Each objACE in arrACEs


if Left(objACE.Trustee.Name,7) = "FR_DEPT" then
f.write(strFolderName & " ")
f.write(objACE.Trustee.Domain & "\" & objACE.Trustee.Name + VbCrLf)

WScript.Echo strFolderName
WScript.Echo objACE.Trustee.Domain & "\" & objACE.Trustee.Name

else
if Left(objACE.Trustee.Name,5) = "LTGFR" then
f.write(strFolderName & " ")
f.write(objACE.Trustee.Domain & "\" & objACE.Trustee.Name + VbCrLf)

WScript.Echo strFolderName
WScript.Echo objACE.Trustee.Domain & "\" & objACE.Trustee.Name
end if


end if
next
AnswerRe: concatenate 2 scripts PinmemberEddy Vluggen18-Dec-12 22:55 
Questionsystem.net.mail - manage multiple attachment Pinmemberalejx14-Dec-12 14:00 
AnswerRe: system.net.mail - manage multiple attachment PinmemberEddy Vluggen17-Dec-12 2:17 
QuestionHelp with Class Library and "Roll Your Own MsgBox" Pinmemberw4uoa13-Dec-12 6:19 
AnswerRe: Help with Class Library and "Roll Your Own MsgBox" PinmemberSimon_Whale13-Dec-12 6:38 
AnswerRe: Help with Class Library and "Roll Your Own MsgBox" PinmvpRichard MacCutchan13-Dec-12 6:40 
Questionnewbie Pinmembervaskoedo12-Dec-12 3:16 
AnswerRe: newbie PinmemberEddy Vluggen12-Dec-12 4:02 
QuestionExcel.XlChartType.xlLine chart not draw using VB.Net PinmemberD.Manivelan11-Dec-12 20:32 
AnswerRe: Excel.XlChartType.xlLine chart not draw using VB.Net PinmemberEddy Vluggen12-Dec-12 4:00 
QuestionMake a DataGridView column editable PinmemberJohn Waclawski11-Dec-12 12:01 
AnswerRe: Make a DataGridView column editable PinmemberEddy Vluggen12-Dec-12 3:58 
Questionportability/deployment, VB/Database PinmemberMember 838594911-Dec-12 5:34 
AnswerRe: portability/deployment, VB/Database PinmemberEddy Vluggen11-Dec-12 5:51 
GeneralRe: portability/deployment, VB/Database PinmemberMember 838594911-Dec-12 6:04 
QuestionUSBMuxd PinmemberD_Wilbur10-Dec-12 10:19 
AnswerRe: USBMuxd PinmemberEddy Vluggen11-Dec-12 3:24 
Questionneed vb.net DMS system PinmemberMember 967170910-Dec-12 1:10 
AnswerRe: need vb.net DMS system PinmvpDave Kreskowiak10-Dec-12 3:21 
GeneralRe: need vb.net DMS system PinmemberSimon_Whale11-Dec-12 6:36 
AnswerRe: need vb.net DMS system PinmemberPaul Conrad13-Dec-12 9:56 
AnswerRe: need vb.net DMS system PinmemberPrissySC26-Dec-12 3:48 
Questionparent/child bindingsource save new fails PinmemberPrissySC8-Dec-12 12:03 
AnswerRe: parent/child bindingsource save new fails PinmemberEddy Vluggen11-Dec-12 3:21 
GeneralRe: parent/child bindingsource save new fails PinmemberPrissySC26-Dec-12 3:47 
Questionread mail from yahoo using yahoo api in vb.net Pinmemberpuvanar8-Dec-12 0:01 
AnswerRe: read mail from yahoo using yahoo api in vb.net PinmemberEddy Vluggen10-Dec-12 0:14 
QuestionMissing Toolbar PinmemberNo-e6-Dec-12 7:09 
AnswerRe: Missing Toolbar PinmemberPeter_in_27806-Dec-12 14:08 
AnswerRe: Missing Toolbar PinmemberEddy Vluggen6-Dec-12 15:23 
QuestionHow to insert xml to dataset.xsd using vb.net? PinmemberAkbarblack5-Dec-12 20:20 
QuestionDrawing an image onto a form Pinmembertuffhamster2-Dec-12 9:13 
AnswerRe: Drawing an image onto a form PinmemberEddy Vluggen3-Dec-12 1:53 
Questionprogramming thesis VB.net Pinmemberenzomatriz30-Nov-12 15:48 
AnswerRe: programming thesis VB.net PinmvpDave Kreskowiak1-Dec-12 4:17 
AnswerRe: programming thesis VB.net PinmemberZaf Khan1-Dec-12 11:01 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.150414.1 | Last Updated 19 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid