DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 23 Aug 2007 06:36:04 -0700,    posted on: microsoft.public.dotnet.languages.vb        back       

Thread Index
  1    Liam Mac


creating remote shares using vb.net   
Folks,
 
I don't think came across this situation before but I cannot get any answers 
or direction on what I thought loads of people would have try. A wee bit of 
history, I have application in Access using VBA code to do loads of stuff for 
creating user accounts which works great, but now I'm in the process of 
changing into vb.net environment and getting most of the functionally to work 
as my access application, one of the automated tasks my access application 
does is create home directories on remote file server and set share 
permission on that server for each new user, I use WMI scripting within my 
access application. However, I cannot get the same code to work in vb.net 
environment and I cannot find resources on how to do this in vb.net. Has 
anyone any suggesting or is it a case I just go back to Access.....
 
Sample of WMI code that works, can 
 
et objWMIService = GetObject _
    ("winmgmts:\\" & strServerName & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create _
    ("cmd.exe /cmd " & strFullPath & "", Null, Null, intProcessID)

' setting the sharing of a folder
Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 25

Set objWMIService = GetObject _
    ("winmgmts:\\" & strServerName & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
strShareName = strGCN & "$"
errReturn = objNewShare.Create("" & strFullPath & "", "" & strShareName & 
"", FILE_SHARE, MAXIMUM_CONNECTIONS, "X Drive")
 
Cheers,
Liamo
Date:Thu, 23 Aug 2007 06:36:04 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us