PowerShell 创建网络共享

若要创建网络共享,请使用 Win32_Share 的 Create 方法:

(Get-CimInstance -List |
  Where-Object {$_.Name -eq 'Win32_Share'}).Create(
    'C:/temp','TempShare',0,25,'test share of the temp folder'
  )

还可以在 Windows 上的 PowerShell 中使用 net share 来创建共享:

net share tempshare=c:/temp /users:25 /remark:"test share of the temp folder"

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/266821.html

(0)
上一篇 2022年6月7日 23:38
下一篇 2022年6月7日 23:38

相关推荐

发表回复

登录后才能评论