Solved

nt directory security info

Posted on 1998-05-22
13
162 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
Comment Utility
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
Comment Utility
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
Comment Utility
No I don't, I thought you question was about NTFS Permissions!
0
 

Author Comment

by:1234567
Comment Utility
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
Comment Utility
Please post the reason why you reject my answer?
0
 

Author Comment

by:1234567
Comment Utility
a little effort would be nice
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:zsi
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry for my mistake... :)))))
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now