Create a Simple file share from command line

June 1, 2009 at 15:09:15
Specs: Windows XP
Does anyone know the command to make a simple file share at the command prompt? I need the share to be accessible by all, just as if I had opened file sharing on a particular folder and choose "just enable file sharing" (e.g. http://www.practicallynetworked.com... but from a command prompt. I am a programmer, so if there is a particular registry key i can change to accomplish this or something of that nature, that would be welcome information too, though command line option is preferred. Thanks!


See More: Create a Simple file share from command line

Report •


#1
June 1, 2009 at 15:37:09
Investigate commands
net share
net use

Report •

#2
June 1, 2009 at 16:08:31
been trying that for the last 4 hours. I've even tried getting rmtshare.exe from the windows resource kit. I cannot get any of these to create a SIMPLE share that does not require authentication. :(

Report •

#3
June 1, 2009 at 16:25:21
"that does not require authentication"

Good luck with that as in isn't going to happen.

It is a requirement to authenicate before you can access a share. Part of authenication is what rights/what groups you belong to and what level of access you are granted at each level.

You can set the share to be to everyone with full control. That is complete and open access.

You then have to authenicate either as Guest [if enabled] or User [logon account] to then gain access to the share.

Windows 9x days are long gone.


Report •

Related Solutions

#4
June 2, 2009 at 06:45:45
I CAN do what I want in XP. In my first post, I gave a link for an example of what I want to recreate. I can go into the folders properties, enable file sharing, and then go to another machine and open the share right up with no prompt for credentials.

Its "Simple File Sharing" with level 5 access
http://support.microsoft.com/kb/304040

If I follow the GUI method to setup the share, anything with an ip in the same network can get right in with no credentials prompt. This is the type of a share I need.

Any idea how to do it from a command line or program?


Report •

#5
June 2, 2009 at 08:08:04
Ok, the command below appears to make everything in the gui look right, but I get access denied errors on the share until I go into folder properties -> Sharing tab, change ANYTHING and change it back (so the apply button will enable), then hit apply and only then can I access the share. This is so frustrating :(

rmtshare \\PCCHIPS\share="C:\Program Files\Microsoft SQL Server" /grant everyone:f


Report •

#6
June 2, 2009 at 08:37:17
Edit: Well, this is only part of the solution. it doesn't work on machines that don't have simple file sharing enabled already. Gotta figure that out still, but will post back :(

FINALLY ! :)


If i first run:
rmtshare \\PCCHIPS\movieMaker="C:\Program Files\Movie Maker" /grant everyone:f

Then run (exe from http://setacl.sourceforge.net/):
SetACL.exe -on "\\PCCHIPS\movieMaker" -ot file -actn ace -a
ce "n:S-1-1-0;p:full;s:y"

I get the share I need without any prompt for permissions now. Basically, were creating the share giving everyone full permissions, then using SetACL to rewrite the permissions? Not sure why I need to do it this way, but it works! :)

Thanks for reading and replying wanderer.

EDIT:
As an alternative to using rmtshare, I did find that net share works in combination with SetACL.exe just as well:

net share movieMaker="C:\Program Files\Movie Maker"


Report •


Ask Question