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. file permission in vb

file permission in vb

Scheduled Pinned Locked Moved Visual Basic
sysadminhelpquestion
3 Posts 3 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.
  • U Offline
    U Offline
    uktrips007
    wrote on last edited by
    #1

    Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others

    J D 2 Replies Last reply
    0
    • U uktrips007

      Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others

      J Offline
      J Offline
      Jottum
      wrote on last edited by
      #2

      Disable File Sharing for your App folder and it can only be xecuted from the local computer. However, if the user has sufficient permissions they can share it anyway and still launch your App from the network. I can't check the below code right now, no network. So forgive me if it doesn't work. - Create a new project - Add two labels next to each other on form one. Private Sub Form_Load()    Label1.Caption = "Path:"    'If you only want one instance of your app    If App.PrevInstance Then       MsgBox "You are not allowed to start more then one instance of My App.", vbExclamation + vbOKOnly, "My App"       Unload Me    End If    Label2.Caption = App.Path 'Display path.    ' Check if excuted from network    If InStrB(Label2.Caption, "\\") <> 0 Then ' Double slash is network path       MsgBox "You are not allowed to start My App from a remote computer.", vbExclamation + vbOKOnly, "My App"    Unload Me    End If End Sub Compile the code and run the exe. Run it again while the other is still open and see what happens. Close the exe. Now start it from a different computer on your network and see if it starts or displays the message. HTH Jottum -- modified at 8:45 Friday 11th November, 2005

      1 Reply Last reply
      0
      • U uktrips007

        Dear friends:confused: hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared. actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.:confused: be the best...be helpful for others

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        There's nothing you can do in your code to prevent this. Even if your installation removes the share, there is nothing preventing the admin of the machine from just sharing the folder your app is stored in and nothing you can do to prevent it. You have absolutely no control over this. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        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