Simple App - Set local folder as shared and set Permissons. How to?
I am trying to create a simple app that will prompt the user to input a string (will be computer name) and set a pre-existing folder on the computer as shared, give it a name, and set its permissions. It does not have to have any sort of echo function but would be nice.
Example:
Prompt entry is abcdefg
it will set C:\Program Files\Folder as shared \\computer\share_abcdefg$
remove "everyone" from permissions and add "systems"
I dont even know where to begin as I could not find anything to do with setting shares in my searches, only local security :(
Thanks to anyone that can help!
Re: Simple App - Set local folder as shared and set Permissons. How to?
Quote:
Originally posted by Scary_Penguin
I am trying to create a simple app that will prompt the user to input a string (will be computer name) and set a pre-existing folder on the computer as shared, give it a name, and set its permissions. It does not have to have any sort of echo function but would be nice.
Example:
Prompt entry is abcdefg
it will set C:\Program Files\Folder as shared \\computer\share_abcdefg$
remove "everyone" from permissions and add "systems"
I dont even know where to begin as I could not find anything to do with setting shares in my searches, only local security :(
Thanks to anyone that can help!
well I dont know if winxp home would have this (not even sure what it might be in win2k and pre-win2k OS)...
but if you have winxp, or newer, try the "net" command with the share paramter: so for example type this in the command prompt:
Net Share myNewShare="C:\program files"
that will create a new share called \\[Computer Name]\myNewShare.
you can put that in code like this:
VB Code:
Dim p As New Process
p.Start("Net.exe", "Share myNewShare=""C:\program files""")
all that said, I dont know if that is the right way. There may be APIs for doing this, I don't know. I don't know how you can change user permissions for a share, maybe you should ask this in a newsgroup.