Corrigindo problemas da Diretiva de Grupo usando arquivos de log
Ativar o registro em log das extensões do cliente do Editor de objeto de diretiva de grupo
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
GPTextDebugLevel REG_DWORD 0x30002
0 / ver registros:
%windir%\debug\usermode\gptext.log
1/32-bit run vbscript:
%windir%\syswow64\cscript.exe "C:\myscript.vbs"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections" REG_DWORD 1
3 / Desativar o UAC
linha de comando:
vbs-32.cmd ExcelSheetName.vbs ExcelSrc.xls
vbs-32.cmd:
SET WSH32=%windir%\SysWOW64\cscript.exe
%WSH32% %*
SheetName.vbs:
'Microsoft ActiveX Data Object 2.8 Library
'Microsoft ADO Ext. 2.8 for DDL And Security
Const ArrSize = 100
Dim ArrSheetName()
ReDim ArrSheetName(ArrSize)
IndexArr = 0
IF WScript.Arguments.Count = 0 Then
WScript.Echo "Script Usage:"
WScript.Echo "%windir%\SysWOW64\cscript.exe ExcelSheetName.vbs [Excel file full path]"
WScript.Echo "%windir%\SysWOW64\cscript.exe ExcelSheetName.vbs D:\Office\ExcelSrc.xls"
Wscript.Quit(10)
End If
Dim ExcelFileName
ExcelFileName=WScript.Arguments(0)
Dim ADOCatalog, ADOTable, ADODBConnection
Set ADOCatalog = Createobject("ADOX.Catalog")
Set ADOTable = Createobject("ADOX.Table")
Set ADODBConnection = CreateObject("ADODB.Connection")
Dim strConnString, strSheetName
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ExcelFileName & ";Extended Properties=Excel 8.0;"
ADODBConnection.Open strConnString
Set ADOCatalog.ActiveConnection = ADODBConnection
For Each ADOTable In ADOCatalog.Tables
strSheetName = ADOTable.Name
strSheetName = Replace(strSheetName, "'", "")
strSheetName = Left(strSheetName, InStr(1, strSheetName,"$", 1)-1)
'Wscript.Echo strSheetName
ArrSheetName(IndexArr)=strSheetName
IndexArr=IndexArr+1
Next
ReDim Preserve ArrSheetName(IndexArr-1)
ADODBConnection.Close
Set ADOCatalog = Nothing
Set ADOTable = Nothing
Set ADODBConnection = Nothing
For Each ArrValue in ArrSheetName
Wscript.Echo ArrValue
Next