Commit c9505b39d46078b2db92dfb41304cfbaeb5223ac

Authored by Emerson Piana Costa
1 parent 6ce63dd4
Exists in master

Corrigido para a ultima atualização utilizada em Guarapari

Showing 1 changed file with 10 additions and 43 deletions   Show diff stats
SetPermissions.hta
... ... @@ -40,9 +40,8 @@ font-weight: bold;
40 40 </HEAD>
41 41  
42 42 <SCRIPT LANGUAGE="VBScript">
43   - Dim fso, oFile
44   - 'Set fso = CreateObject("Scripting.FileSystemObject")
45   - Set objFSO = CreateObject("Scripting.FileSystemObject")
  43 + Dim fso, oFile
  44 + Set fso = CreateObject("Scripting.FileSystemObject")
46 45 Set objShell = CreateObject("WScript.Shell")
47 46  
48 47 Sub Window_Onload
... ... @@ -87,44 +86,13 @@ font-weight: bold;
87 86  
88 87 '<!--#######################[ Buttons Actions ]#######################-->
89 88 Sub TestScript
90   - strDirectory = "q:\"
91 89 strServer = AvailableServer.Value
92 90 strGroup = GroupName.Value
93 91 strPermission = right(strGroup,1)
94 92 strPermission = replace(strPermission, "L", "RX")
95 93 strPermission = ":" & strPermission
96   - 'MsgBox strPermission
97 94 strFolder = mid(strGroup, 7, len(strGroup) - 8)
98 95 strFolder = replace(strFolder, "-", "\")
99   - '########separa "-" dos diretorios
100   - 'WrdArray = split(strFolder,"-")
101   - 'MsgBox WrdArray
102   - 'For nF = 0 To UBound(WrdArray)
103   - ' strDirectory = "q:\AD"
104   - ' MsgBox WrdArray(nF)
105   - 'Next
106   - 'fim ########
107   -
108   - 'cria pasta############
109   - MsgBox strDirectory&strFolder
110   -
111   - If objFSO.FolderExists(strDirectory&strFolder) Then
112   - Set objFolder = objFSO.GetFolder(strDirectory&strFolder)
113   - MsgBox strFolder & " already created "
114   - Else
115   - Set objFolder = objFSO.CreateFolder(strDirectory&strFolder)
116   - MsgBox "Just created " & strFolder
117   - End If
118   -
119   - If err.number = vbEmpty then
120   - Set objShell = CreateObject("WScript.Shell")
121   - objShell.run ("Explorer" &" " & strDirectory&strFolder & "\" )
122   - Else
123   - MsgBox "VBScript Error: " & err.number
124   - End If
125   - '##################
126   -
127   -
128 96  
129 97 MsgBox "You Selected:" & VBCRLF & _
130 98 "Server: " & strServer & VBCRLF & _
... ... @@ -134,7 +102,6 @@ font-weight: bold;
134 102  
135 103 sCMD=("%COMSPEC% /C Echo Y| icacls " & strServer & "\" & strFolder & " /t /c /grant " & strGroup & strPermission)
136 104 MsgBox sCMD, 64,"Debug Command Box"
137   -
138 105 End Sub 'TestScript
139 106  
140 107 Sub EditServer
... ... @@ -209,18 +176,18 @@ font-weight: bold;
209 176 Set objFSO = CreateObject("Scripting.FileSystemObject")
210 177 If objFSO.FolderExists(strServer & "\" & strShare & "\" & strFolder) Then
211 178  
212   - ' definição de permissoes.
  179 + ' definição de permissoes.
213 180 'Notes
214   - '/t aplicar as permissões nas subpastas e arquivos a partir desta pasta
  181 + '/t aplicar as permissões nas subpastas e arquivos a partir desta pasta
215 182 '/c continua o script mesmo com erro
216   - '/grant Administrators (Seta permissões para Administrators)
  183 + '/grant Administrators (Seta permissões para Administrators)
217 184 ':F (para acesso full), :RX (Ler e Executar), :M (Modificar), :WD (Adiciona arquivos), :AD (Adiciona diretorios)
218 185 '(OI) pasta e arquivos
219 186 '(CI) pasta e subpastas
220 187 '(IO) propaga apenas aos filhos
221   - '(NP) não propaga aos filhos
  188 + '(NP) não propaga aos filhos
222 189  
223   - UpdateGroup 'Atualiza descrição do grupo
  190 + UpdateGroup 'Atualiza descrição do grupo
224 191  
225 192 ' define permissoes para a pasta base.
226 193 If strPermission = "F" Then
... ... @@ -246,7 +213,7 @@ font-weight: bold;
246 213 'MsgBox "%COMSPEC% /C Echo Y| icacls " & strServer & "\" & strShare & "\" & strFolder & " /c /grant " & strGroup & ":" & strPermission , 48, "Attention"
247 214 End If 'intRunError <> 0
248 215  
249   - ' define permissoes de leitura à pastas anteriores à pasta base.
  216 + ' define permissoes de leitura à pastas anteriores à pasta base.
250 217 do while InStr(strFolder,"\") > 0
251 218 'MsgBox "Folder " & VBCRLF & strServer & "\" & strShare & "\" & strFolder & VBCRLF & "possui pasta anterior" , 48, "Attention"
252 219 strBeforeFolder = strBeforeFolder & mid(strFolder,1,InStr(strFolder,"\"))
... ... @@ -276,13 +243,13 @@ font-weight: bold;
276 243 }>">
277 244 <a name="Top"></a>
278 245 <CENTER>
279   - <p>O nome do grupo deverá estar cadastrado no AD, e deverá existir o caminho de acordo com o nome do grupo.</p>
  246 + <p>O nome do grupo deverá estar cadastrado no AD, e deverá existir o caminho de acordo com o nome do grupo.</p>
280 247 <table border="0" cellpadding="0" cellspacing="0"><font size="2" color="black" face="Arial">
281 248 <tr>
282 249 <td height="30"><p align="right">Server</p></td>
283 250 <td height="45">&nbsp;&nbsp; <select size="1" name="AvailableServer" size="30"></select>&nbsp;&nbsp;<input type="button" value="Edit" onclick="EditServer">&nbsp;<input type="button" value="Reload" onclick="ReloadServer"></td></tr>
284 251 <tr>
285   - <td height="30"><p align="right">Nome do grupo</p></td>
  252 + <td height="30"><p align="right">Group Name</p></td>
286 253 <td height="45">&nbsp;&nbsp; <input type="text" name="GroupName" size="45"></td></tr>
287 254 </table><BR>
288 255  
... ...