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