Hi,
I am trying below code to share the folder i created, but i am getting "Folder not shared" all times, dont know what is wrong in this code, and i am not sure whether sharename is wrong, please clear this issue
Const FILE_SHARE = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create(strFolder, "FinanceShare", FILE_SHARE, , "Public share for Project.")
If errReturn = 0 Then
MsgBox "Folder Shared"
Else
MsgBox "Folder Not Shared"
End If
End Sub
Thanks,
Venkata Shabarish M
I am trying below code to share the folder i created, but i am getting "Folder not shared" all times, dont know what is wrong in this code, and i am not sure whether sharename is wrong, please clear this issue
Const FILE_SHARE = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create(strFolder, "FinanceShare", FILE_SHARE, , "Public share for Project.")
If errReturn = 0 Then
MsgBox "Folder Shared"
Else
MsgBox "Folder Not Shared"
End If
End Sub
Thanks,
Venkata Shabarish M