title image


Smiley Re: check ob freigabe auf anderem rechner existiert wenn nicht= erstellen
copy und paste aus MS Portable Script Center:



(WMI ist the game... ((-; )



List Shares:



strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")



Set colShares = objWMIService.ExecQuery("Select * from Win32_Share")



For each objShare in colShares

Wscript.Echo "Allow Maximum: " & objShare.AllowMaximum

Wscript.Echo "Caption: " & objShare.Caption

Wscript.Echo "Maximum Allowed: " & objShare.MaximumAllowed

Wscript.Echo "Name: " & objShare.Name

Wscript.Echo "Path: " & objShare.Path

Wscript.Echo "Type: " & objShare.Type

Next



Create Share:



Const FILE_SHARE = 0

Const MAXIMUM_CONNECTIONS = 25



strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")



Set objNewShare = objWMIService.Get("Win32_Share")



errReturn = objNewShare.Create _

("C:\Finance", "FinanceShare", FILE_SHARE, _

MAXIMUM_CONNECTIONS, "Public share for the Finance group.")






mfg Mike

Snafu



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: