Solved

nt directory security info

Posted on 1998-05-22
13
166 Views
Last Modified: 2008-03-06
I want to write a program like the NT Explorer to quickly show the NTFS Permissions on directories.....Need some code.
0
Comment
Question by:1234567
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1457482
1234567,

1- Add form1 to project1.
2- Add command1 to form1.
3- Paste the the following code:

Private Type SHELLEXECUTEINFO
 cbSize        As Long
 fMask         As Long
 hwnd          As Long
 lpVerb        As String
 lpFile        As String
 lpParameters  As String
 lpDirectory   As String
 nShow         As Long
 hInstApp      As Long
 lpIDList      As Long
 lpClass       As String
 hkeyClass     As Long
 dwHotKey      As Long
 hIcon         As Long
 hProcess      As Long
End Type

Private Const SEE_MASK_INVOKEIDLIST = &HC
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
Private Const SEE_MASK_FLAG_NO_UI = &H400

Private Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long

Private Function ShowProperties(FilePath As String, OwnerhWnd As Long) As Long
 Dim SEI As SHELLEXECUTEINFO
 Dim Ret As Long

 With SEI
  .cbSize = Len(SEI)
  .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
  .hwnd = OwnerhWnd
  .lpVerb = "properties"
  .lpFile = FilePath
  .lpParameters = vbNullChar
  .lpDirectory = vbNullChar
  .nShow = 0
  .hInstApp = 0
  .lpIDList = 0
 End With

 Ret = ShellExecuteEX(SEI)

 ShowProperties = SEI.hInstApp
End Function

Private Sub Command1_Click()
 ShowProperties "d:\winnt", Me.hwnd
End Sub


Best regards
Bin Huwairib
0
 

Author Comment

by:1234567
ID: 1457483
Do you have also the code to display the user/groups in a domain and change the permissions???

0
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1457484
No I don't, I thought you question was about NTFS Permissions!
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:1234567
ID: 1457485
if anyone knows also the code to list users/groups and change ntfs permissions i'll reward it with 200 points....
0
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1457486
Please post the reason why you reject my answer?
0
 

Author Comment

by:1234567
ID: 1457487
a little effort would be nice
0
 
LVL 4

Expert Comment

by:zsi
ID: 1457488
123-etc, etc.

Bin huwairib answered your question and, if the code works, you must award him the ponits.  You should repost your second question as a new question.  Besides, you don't want to get a reputation for cheating people out of points, do you?

You comment about a lack of effort is silly.  Your question did not require a whole lot of code and is quite easy to do (once you know how).  You now know how, so award the points.

And speaking of effort, how can you criticize Bin for a lack of effort when you couldn't even spend a little time coming up with a decent screen name?  :)
0
 
LVL 4

Expert Comment

by:zsi
ID: 1457489
123-etc, etc.

Bin huwairib answered your question and, if the code works, you must award him the ponits.  You should repost your second question as a new question.  Besides, you don't want to get a reputation for cheating people out of points, do you?

Your comment about a lack of effort is silly.  Your question did not require a whole lot of code and is quite easy to do (once you know how).  You now know how, so award the points.

And speaking of effort, how can you criticize Bin for a lack of effort when you couldn't even spend a little time coming up with a decent screen name?  :)
0
 

Expert Comment

by:dto
ID: 1457490
I think 1234567 is right.

When you cut and paste the code into the project it doesn't even work.

No offense to Bin huwairib or any others :)

Regards,
DTO
0
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1457491
dto,

What do you mean it did not work?!!

First, where did you try it? windows95 or WindowNT.

Second, cut and paste will not work alway because times some grapage might inserted between the lines, you have to filter it before using it, I don't think anyone like to behave as dumb user
then don't call your self a developer.

Bin Huwairib
0
 

Author Comment

by:1234567
ID: 1457492
hey hey hey people don't fight


OK bin_huwairib, i guess i was wrong not to give you the points.....
please answer this question again and i give you 98 point and a A for excellent answer.

fiends again??

Regards,
1324567
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 100 total points
ID: 1457493
1234567,

1- Add form1 to project1.
2- Add command1 to form1.
3- Paste the the following code:

Private Type SHELLEXECUTEINFO
 cbSize        As Long
 fMask         As Long
 hwnd          As Long
 lpVerb        As String
 lpFile        As String
 lpParameters  As String
 lpDirectory   As String
 nShow         As Long
 hInstApp      As Long
 lpIDList      As Long
 lpClass       As String
 hkeyClass     As Long
 dwHotKey      As Long
 hIcon         As Long
 hProcess      As Long
End Type

Private Const SEE_MASK_INVOKEIDLIST = &HC
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
Private Const SEE_MASK_FLAG_NO_UI = &H400

Private Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long

Private Function ShowProperties(FilePath As String, OwnerhWnd As Long) As Long
 Dim SEI As SHELLEXECUTEINFO
 Dim Ret As Long

 With SEI
  .cbSize = Len(SEI)
  .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
  .hwnd = OwnerhWnd
  .lpVerb = "properties"
  .lpFile = FilePath
  .lpParameters = vbNullChar
  .lpDirectory = vbNullChar
  .nShow = 0
  .hInstApp = 0
  .lpIDList = 0
 End With

 Ret = ShellExecuteEX(SEI)

 ShowProperties = SEI.hInstApp
End Function

Private Sub Command1_Click()
 ShowProperties "d:\winnt", Me.hwnd
End Sub


Best regards
Bin Huwairib
0
 

Author Comment

by:1234567
ID: 1457494
Sorry for my mistake... :)))))
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question