sabas
02-04-2004, 12:52 AM
Hi,
I wish to grant full control to users, so I create a batch file named permission.bat with 1 line of code as follows:
echo y|cacls C:\Program Files\myFolder\myFile.mdb /E /G Users:F
and I execute it in Form load:
Private sub Form_Load()
ShellExecute Me.hwnd, "Open", App.Path & "\permission.bat", "", "", 0
End Sub
My declaration for that:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
To see how it works I right click on the file (myFile.mdb), select Properties/Security tab/click on Users in Group or users name panel. The outcome is that users do not have full control as expected because the full control box was unchecked. Could anybody tell me what went wrong? (I'm using WinXP Pro).
Thanks,
I wish to grant full control to users, so I create a batch file named permission.bat with 1 line of code as follows:
echo y|cacls C:\Program Files\myFolder\myFile.mdb /E /G Users:F
and I execute it in Form load:
Private sub Form_Load()
ShellExecute Me.hwnd, "Open", App.Path & "\permission.bat", "", "", 0
End Sub
My declaration for that:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
To see how it works I right click on the file (myFile.mdb), select Properties/Security tab/click on Users in Group or users name panel. The outcome is that users do not have full control as expected because the full control box was unchecked. Could anybody tell me what went wrong? (I'm using WinXP Pro).
Thanks,