Solved

nt directory security info

Posted on 1998-05-22
13
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 68
VBA to copy paste columns form one file to other 20 100
adding "ungroup sheets" to existing vbs code 5 57
Assign a value in Excel V-Basic 3 29
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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