Create hidden share on remote server from vb.net code behind??

  • Thread starter freenews.netfront.net
  • Start date
F

freenews.netfront.net

Hi,

I am writing an asp.net / Active Directory application using vb.net in it's
code-behind pages. The app is running on the W2k3 (r1) domain controller
(e.g. server1). Does anyone know how to create a hidden share, from
vb.net, for an existing folder on a remote server? e.g. for a folder
\\server2\D$\foldera\folderb\123456 I want to create a share on server2
\\server2\123456$ and give user 123456 full control of that folder.

Thanks for thinking about this, if you do, and apologies if this is the
wrong group..

Arth.
 
D

Daniel Fisher\(lennybacon\)

Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 25
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create _
("C:\Finance", "FinanceShare", FILE_SHARE, _
MAXIMUM_CONNECTIONS, "Public share for the Finance group.")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top