本文发表在 rolia.net 枫下论坛my co-worker wanted me to find a easy way to do this. I thought of the array method, original code is as following....
"
Sub fin_sbarep11(strAppID)
Dim strAppDir, strSetup, strSecGrp, strGrpDesc, strProgDir
'***********************************
'* SBA Reporting Corporations V1.1*
'***********************************
strAppDir = strLobDir & "\Common\" & strAppID
strSetup = strAppDir & "\sbarep11.msi allusers=2 /qb-"
AppInstall strAppID, strSetup, strAppDir & "\" & strAppID & ".reg"
strProgDir = vbQt & "c:\program files\SBA Electronic Reporting Corporations" & vbQt
strShCutDir = vbQt & "C:\Documents and Settings\All Users\Start Menu\Programs\SBA Electronic Reporting (C)" & vbQt
strSecGrp = "AppSBARep"
strGrpDesc = "SBA Reporting Corporations Users"
CreateLocalGroup strSecGrp, strGrpDesc
Global2Local strDomain, strSecGrp, strSecGrp
objWshShell.Run iGrant & " -hideprop protect " & strProgDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":Modify,Modify,Modify " & strProgDir, 1, TRUE
objWshShell.Run irevoke & " -r -rd -ru -hideprop users:cteau,cteau,cteau " & strProgDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop protect " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":cteau,cteau,cteau " & strShCutDir, 1, TRUE
objWshShell.Run irevoke & " -r -hideprop users:cau,cau,cau " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop users:TE " & strShCutDir, 1, TRUE
End Sub
Sub fin_txbro10(strAppID)
Dim strAppDir, strSetup, strSecGrp, strGrpDesc, strProgDir
'********************************
'* Transaction History Browser *
'********************************
strAppDir = strLobDir & "\Common\" & strAppID
strSetup = strAppDir & "\setup /s"
AppInstall strAppID, strSetup, strAppDir & "\" & strAppID & ".reg"
AddPath "c:\Progra~1\pb6dll\"
strProgDir1 = vbQt & "C:\Program Files\TX_BROW" & vbQt
strProgDir2 = vbQt & "C:\Program Files\pb6dll" & vbQt
strShCutDir = vbQt & "C:\Documents and Settings\All Users\Start Menu\Programs\Browser" & vbQt
strSecGrp = "AppTxBro11"
strGrpDesc = "Transaction History Browser Users"
CreateLocalGroup strSecGrp, strGrpDesc
Global2Local strDomain, strSecGrp, strSecGrp
objWshShell.Run iGrant & " -hideprop protect " & strProgDir1, 1, TRUE
objWshShell.Run iGrant & " -hideprop protect " & strProgDir2, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":Modify,Modify,Modify " & strProgDir1, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":Modify,Modify,Modify " & strProgDir2, 1, TRUE
objWshShell.Run irevoke & " -r -rd -ru -hideprop users:cteau,cteau,cteau " & strProgDir1, 1, TRUE
objWshShell.Run irevoke & " -r -rd -ru -hideprop users:cteau,cteau,cteau " & strProgDir2, 1, TRUE
objWshShell.Run iGrant & " -hideprop protect " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":cteau,cteau,cteau " & strShCutDir, 1, TRUE
objWshShell.Run irevoke & " -r -hideprop users:cau,cau,cau " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop users:TE " & strShCutDir, 1, TRUE
End Sub
Sub fin_pfsct12(strAppID)
Dim strAppDir, strSetup, strSecGrp, strGrpDesc, strProgDir
'**********************
'* Comshare Decision *
'**********************
strAppDir = strLobDir & "\Common\" & strAppID
strSetup = strAppDir & "\pfsct12.msi allusers=2 /qb-"
AppInstall strAppID, strSetup, strAppDir & "\" & strAppID & ".reg"
AddPath "c:\Program Files\ComShare\Shared~1;"
strProgDir1 = vbQt & "c:\program files\comshare" & vbQt
strProgDir2 = vbQt & "c:\program files\decision" & vbQt
strShCutDir = vbQt & "C:\Documents and Settings\All Users\Start Menu\Programs\Decision" & vbQt
strSecGrp = "AppDecision"
strGrpDesc = "Comshare Decision Users"
CreateLocalGroup strSecGrp, strGrpDesc
Global2Local strDomain, strSecGrp, strSecGrp
objWshShell.Run iGrant & " -hideprop protect " & strProgDir1, 1, TRUE
objWshShell.Run iGrant & " -hideprop protect " & strProgDir2, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":Modify,Modify,Modify " & strProgDir1, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":Modify,Modify,Modify " & strProgDir2, 1, TRUE
objWshShell.Run irevoke & " -r -rd -ru -hideprop users:cteau,cteau,cteau " & strProgDir1, 1, TRUE
objWshShell.Run irevoke & " -r -rd -ru -hideprop users:cteau,cteau,cteau " & strProgDir2, 1, TRUE
objWshShell.Run iGrant & " -hideprop protect " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop " & strSecGrp & ":cteau,cteau,cteau " & strShCutDir, 1, TRUE
objWshShell.Run irevoke & " -r -hideprop users:cau,cau,cau " & strShCutDir, 1, TRUE
objWshShell.Run iGrant & " -hideprop users:TE " & strShCutDir, 1, TRUE
End Sub
strAppID = "sbarep11"
strAppDesc = objWshShell.RegRead("HKLM\Software\COE\" & strAppID)
If Err Then
fin_sbarep11 strAppID
End If
Err.Clear
strAppID = "txbro10"
strAppDesc = objWshShell.RegRead("HKLM\Software\COE\" & strAppID)
If Err Then
fin_txbro10 strAppID
End If
Err.Clear
strAppID = "pfsct12"
strAppDesc = objWshShell.RegRead("HKLM\Software\COE\" & strAppID)
If Err Then
fin_pfsct12 strAppID
End If
Err.Clear
"
This is a part of the whole script , Do you have any solutions to make it easier read and coded by array.
Thanks更多精彩文章及讨论,请光临枫下论坛 rolia.net