[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

nt directory security info

Posted on 1998-05-22
13
Medium Priority
?
184 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
Industry Leaders: 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!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…
Suggested Courses

650 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