This is really a headache for me

Author Message
winger.love

  • Total Posts : 5
  • Scores: 0
  • Reward points : 0
  • Joined: 12/7/2011
  • Status: offline
This is really a headache for me Thursday, December 08, 2011 2:41 PM (permalink)
0
Would you give me same explanation, or any materials,any help is appreciate!
 
Function CreateNewShareAppDir()
Dim strComputer
Dim objWMIService
Dim objNewShare
Dim Services
Dim SecDescClass
Dim SecDesc
Dim Trustee
Dim ACE
Dim Share
Dim InParam
Dim FolderName
Dim AdminServer
Dim ShareName
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
 
FolderName ="C:\Product \App"
AdminServer = "\\" & strComputer
ShareName = "AtFeeApp"
 
Set Services = GetObject("WINMGMTS:{impersonationLevel=impersonate,(Security)}!"[/style] & AdminServer & "\ROOT\CIMV2")
Set SecDescClass = Services.Get("Win32_SecurityDescriptor")[/style]
Set SecDesc = SecDescClass.SpawnInstance_()[/style]
 
Set Trustee = Services.Get("Win32_Trustee").SpawnInstance_[/style]
Trustee.Domain = Null[/style]
Trustee.Name = "EVERYONE"[/style]
Trustee.Properties_.Item("SID") = Array(1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0)[/style]
 
Set ACE = Services.Get("Win32_Ace").SpawnInstance_[/style]
ACE.Properties_.Item("AccessMask") = 1179817 '2032127 = "Full"; 1245631 = "Change"; 1179817 = "Read"[/style]
ACE.Properties_.Item("AceFlags") = 3[/style]
ACE.Properties_.Item("AceType") = 0[/style]
ACE.Properties_.Item("Trustee") = Trustee[/style]
SecDesc.Properties_.Item("DACL") = Array(ACE)[/style]
 
Set Share = Services.Get("Win32_Share")[/style]
Set InParam = Share.Methods_("Create").InParameters.SpawnInstance_()[/style]
InParam.Properties_.Item("Access") = SecDesc[/style]
InParam.Properties_.Item("Description") = "Public Share"[/style]
InParam.Properties_.Item("Name") = ShareName[/style]
InParam.Properties_.Item("Path") = FolderName[/style]
InParam.Properties_.Item("Type") = 0[/style]
Share.ExecMethod_ "Create", InParam[/style]
End Function
 
#1
    Wakawaka

    • Total Posts : 456
    • Scores: 23
    • Reward points : 0
    • Joined: 8/27/2009
    • Status: offline
    Re:This is really a headache for me Friday, December 09, 2011 1:08 AM (permalink)
    0
    Can you start with telling us what issues you are having with your script?
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9