Dim objfso,myfile
Set objfso=CreateObject("scripting.filesystemobject")
If Not objfso.FolderExists(designPath&"\"&projectname) Then
objfso.CreateFolder(designPath&"\"&projectname)
End If
If Not objfso.FolderExists(designPath&"\"&projectname&"\"&designname) Then
objfso.CreateFolder(designPath&"\"&projectname&"\"&designname)
End If
'grant preview to the designer(layout engineer) and owener(hardward design engineer)
Set objShell = CreateObject("Wscript.Shell")
'MsgBox "grant.bat """&designPath&"\"&projectname&"\"&designname&""" "&pba&" """&designname&""""
objShell.Run "grant.bat """&designPath&"\"&projectname&"\"&designname&""" "&pba&" """&designname&""" PBA"
DOS:(grant.bat)需要文件xcacls.vbs
cscript.exe xcacls.vbs %1 /t /e /g %2:f
net share %3=%1 /grant:%2,change
'需要xcacls.vbs的支持,如沒有,需自行下載,這個是微軟官方產品。對於win7以上系統,需要自行修改其中對OS版本的判斷。