删除网络共享名 [英] Remove network share name

查看:64
本文介绍了删除网络共享名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从命令行中删除了网络共享名称.语法是``net share ShareName/delete''
如何通过编码从本地计算机中删除网络共享名?

请帮助我....

I remove the network share name from command line.The Syntax is ''net share ShareName /delete''
How will i remove network share name from local computer through coding??

Please help me....

推荐答案

您可以使用Process.Start运行命令行...
但是,这也应该起作用:
You could use Process.Start to run the command line...
But, this should work as well:
Private Shared Function DeleteShare(shareName As String) As Integer
    Using o As New ManagementObject("root\cimv2", "Win32_Share.Name='" & shareName & "'", Nothing)
        Dim mbo As ManagementBaseObject = o.InvokeMethod("delete", Nothing, Nothing)
        Return CInt(mbo.Properties("ReturnValue").Value)
    End Using
End Function


这篇关于删除网络共享名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆