Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Check the write permission of any folder

Check the write permission of any folder

Scheduled Pinned Locked Moved Visual Basic
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunil goyalG
    wrote on last edited by
    #1

    hi all, how can i check whether any folder contains the permission for write ? Please suggest.

    K 1 Reply Last reply
    0
    • S sunil goyalG

      hi all, how can i check whether any folder contains the permission for write ? Please suggest.

      K Offline
      K Offline
      Khatri Mitesh
      wrote on last edited by
      #2

      Try this code. This code set the permission. may be this Helps you.

      Function SetPermissions()
      Dim strHomeFolder, strHome, strUser
      Dim intRunError, objShell, objFSO

          strHomeFolder = "C:\\Test"
      
          objShell = CreateObject("Wscript.Shell")
          objFSO = CreateObject("Scripting.FileSystemObject")
          If objFSO.FolderExists(strHomeFolder) Then
              intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " & strHomeFolder & " /t /c /g everyone:F ", 2, True)
      
              If intRunError <> 0 Then
                  Wscript.Echo("Error assigning permissions for user " \_
                  & strUser & " to home folder " & strHomeFolder)
              End If
          End If
      End Function
      

      Thanks Khatri Mitesh

      ~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups