> Can anyone give me a start on how to script creating a
> hidden network share?
Hi
Add a $ behind the share name to make it hidden.
You can use the net.exe command to create the share:
net share /?
With WMI, take a look at "Create a Network Share" here:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/filefolder/default.asp
and to set permissions, you can use setacl.exe:
F:\>SetACL.exe \\%COMPUTERNAME%\Tst$ /share /set Everyone /read
SUCCESS: Specified permissions set on object <\\A425220\Tst$>.
Finished. All operations completed successfully.
SetACL.exe: SetACL - Windows permission management: Set permissions on
virtually anything
http://setacl.sourceforge.net/
SetACL can set permissions on:
Local or remote directories
Local or remote files
Local or remote printers
Local or remote registry keys
Local or remote Win32 services
Local or remote network shares
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
>.
>
> I was wanting to do this through VB Script. I have
> referenced the link you gave, but it does not create the
> share it says its suppose to.
Hi
The "Create a Network Share" script at
http://www.microsoft.com/technet/scriptcenter/filefolder/ScrFF13.asp works fine
for me (Win2k). Note that the folder you want to share out needs to exist
before you run the script (the first parameter in the objNewShare.Create
method).
When you ran the script, what number did the command "Wscript.Echo errReturn"
return?
You can use "net.exe share" from a vbscript as well:
Set oShell = CreateObject("Wscript.Shell")
sShareFolder = "c:\some path"
sShareName = "My hidden share$"
oShell.Run "net.exe share " & Chr(34) & sShareName & Chr(34) _
& "=" & Chr(34) & sShareFolder & Chr(34), 0, True