BAT file to share ext HDD,grant full access

March 16, 2010 at 06:52:39
Specs: Windows XP PRO SP2, 2.0 GHz, 512MB
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

See More: BAT file to share ext HDD,grant full access

Report •


#1
March 16, 2010 at 07:52:24
do a...

net share MyDrive=x:\ /GRANT:Everyone, FULL

to share your drive then on the workstation...

net use X: \\mycomputername\MyDrive


Report •

#2
March 16, 2010 at 09:39:18
It doesn't seem to work.

The name of the drive I wish to share is:
193GB ZAPP OLD STORAGE X

My Computer name is:
zapplaptop

The BAT file I wrote is:
-----------------------------------
net share "193GB ZAPP OLD STORAGE X"=x:\ /GRANT:Everyone, FULL

net use "X: \\zapplaptop\193GB ZAPP OLD STORAGE X"
exit

----------------------------
What am I doing wrong?


Report •

#3
March 16, 2010 at 12:12:21
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.


Report •

Related Solutions

#4
March 16, 2010 at 14:07:06
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.


Report •

#5
March 16, 2010 at 15:28:06
No it is not. look closely. There is no space before the word FULL.

Report •

#6
March 16, 2010 at 17:05:05
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


-----------------


Report •

#7
March 16, 2010 at 19:20:38
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


Report •

#8
March 17, 2010 at 05:40:15
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.

Report •

#9
March 17, 2010 at 18:36:12
You're welcome and thank you for letting us know that it worked...

-- kptech


Report •

#10
September 13, 2010 at 18:00:59
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


Report •

#11
September 13, 2010 at 18:16:30
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.

Ms Hulot goes horse riding


Report •

#12
September 13, 2010 at 19:57:13
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...

Report •


Ask Question