?
Solved

nt directory security info

Posted on 1998-05-22
13
Medium Priority
?
179 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses
Course of the Month10 days, left to enroll

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