I need a BAT file I can run at startup to share a partition (X:\) on my USB external hard drive and grant everyone full access. I would appreciate if anyone could help me here. I have XP-Pro SP2 installed and my computer's name is "zapplaptop" of course without the quotation marks. I have downloaded SetAcl. Thank you
do a... net share MyDrive=x:\ /GRANT:Everyone, FULL
to share your drive then on the workstation...
net use X: \\mycomputername\MyDrive
It doesn't seem to work. The name of the drive I wish to share is:
193GB ZAPP OLD STORAGE XMy Computer name is:
zapplaptopThe BAT file I wrote is:
-----------------------------------
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone, FULLnet use "X: \\zapplaptop\193GB ZAPP OLD STORAGE X"
exit----------------------------
What am I doing wrong?
change net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone, FULL
to
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone,FULL
change
net use "X: \\zapplaptop\193GB ZAPP OLD STORAGE X"
to
net use X: "\\zapplaptop\193GB ZAPP OLD STORAGE X"
Remember the "Net Use" is for the other workstations it will not work on the computer that is sharing the drive.
You state: change
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone, FULL
to
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone,FULL
I don't follow, the second "net share" line is the same as the first so I wouldn't be changing anything.Thanks for the correct "net use" line, I didn't realize it was for the other computers on the network. I really appreciate your help, thanks again for taking the time to help me.
No it is not. look closely. There is no space before the word FULL.
I feel pretty dumb not noticing the removal of the space before FULL. I corrected the BAT file and ran it and the drive is still not shared. Even though I have full administrator's rights I switched users to Administrator and ran the file and still nothing. The current BAT file:
--------------------
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone,FULL
exit
-----------------
Is X: the local drive letter assigned to your external drive or the letter you wish to use when you access it from the remote system(s)? "X" seems pretty far up the alphabet unless you assigned it yourself using the Disk Management Snap-in. You need to make sure you use the local disk letter in the "net share" command on the system that is sharing the drive. Then, you can use any available drive letter, "X" if you prefer, with the "net use" command on the remote system(s).
Also, I if you are not using Windows Server, the /Grant parameter is not recognized. On a Windows XP Pro workstation, you'll want to use the following version of the net share command instead:
net share "193GB ZAPP OLD STORAGE X"=x:\
where x:\ is the local drive letter assigned to your external drive.
"Everyone" will be assigned full read/write permissions by default.
-- kptech
THAT'S IT! IT WORKED! Thank you very much. It works perfectly. To answer your question,
X is both the Drive letter I assigned to the drive using Disk Management and part of the Share name.
You're welcome and thank you for letting us know that it worked... -- kptech
Mr. KPTECH, I read this post and tested it on my machine and it worked for me as well... BUT...
What if I wanted to add a variable? like a folder in that drive...
Example: I have a drive "E" and within that drive I have a folder called "Storage 2" I would like to share...
I tried many possible ways with back slash and stuff but I can't manage to get it to share the folder as oppose to the whole drive...
Would you happen to have an idea for this one?
(( net share "Storage 2"=e: )) works great to share the whole drive...
I tried
(( net share "Storage 2"=E\Folder name: )) but that didn't work...Maybe you can help me figure out what I'm missing???
Thank you in advance
Steven
I know little about it really but the syntax in this line looked a bit odd to me:
(( net share "Storage 2"=E\Folder name: ))Shouldn't it be:
(( net share "Storage 2"=e:\Folder name ))
[Note that I've moved the colon]Otherwise I'll leave you to the experts. If they don't come back to this post raise a new one of your own.
Actually you're right.
I just typed it wrong here. But the way you wrote it was exactly the way I did it in the bin file...
But none the less, thank you for pointing that out !
net share "Storage 2"=e:\Folder name
But still it doesn't share the folder...