This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rodar processo como usuário | |
function WTSQueryUserToken(SessionId: ULONG; var phToken: THandle): BOOL; stdcall; external 'Wtsapi32.dll'; | |
procedure executarApp(appName: string); | |
var | |
hToken: THandle; | |
StartupInfo: TStartupInfo; | |
ProcessInfo: TProcessInformation; | |
res: boolean; | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uses | |
ComObj, ActiveX, JwaWinbase, JwaWtsApi32; | |
{$R *.DFM} | |
procedure ServiceController(CtrlCode: DWORD); stdcall; | |
begin | |
ServiceExample.Controller(CtrlCode); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logoff de usuários desconectados | |
# logoffUsuariosDesconectados.ps1 | |
# Vinícius Lopes de Melo - 07/2021 | |
# $>powershell.exe -noprofile -executionpolicy bypass -file C:\Temp\LogoffProgramado\logoffUsuariosDesconectados.ps1 | |
#Requires -Version 2 | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline = $true, ValueFromPipelinebyPropertyName = $true)] | |
[string[]]$ComputerName = $env:COMPUTERNAME | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-itemproperty -path "HKCU:Control Panel\Desktop" -name WallPaper -value accipiter.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<option value="ABNC">ABNC - Academia Brasileira de Neurocirurgia</option> | |
<option value="AGU">AGU - Advocacia-Geral da União</option> | |
<option value="ANAC">ANAC - Agência Nacional de Aviação Civil</option> | |
<option value="CAER">CAER - Clube de Aeronáutica</option> | |
<option value="CAU">CAU - Conselho de Arquitetura e Urbanismo</option> | |
<option value="CBM">CBM - Corpo de Bombeiro Militar</option> | |
<option value="CFA">CFA - Conselho Federal Administração</option> | |
<option value="CFB">CFB - Conselho Federal de Biblioteconomia</option> | |
<option value="CFBIO">CFBIO - Conselho Federal de Biologia</option> | |
<option value="CFBM">CFBM - Conselho Federal de Biomedicina</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildTree($array, $currentParent, $currLevel = 0, $prevLevel = -1) { | |
foreach ($array as $categoryId => $category) { | |
if ($currentParent == $category['parent_id']) { | |
if ($currLevel > $prevLevel) echo "<ol id='menutree'>"; | |
if ($currLevel == $prevLevel) echo "</li>"; | |
echo '<li> <label class="menu_label" for='.$categoryId.'>'.$category['name'].'</label><input type="checkbox" id='.$categoryId.' />'; | |
if ($currLevel > $prevLevel) { $prevLevel = $currLevel; } | |
$currLevel++; | |
buildTree ($array, $categoryId, $currLevel, $prevLevel); | |
$currLevel--; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Connecting to Database tempdb*/ | |
mysql_connect('localhost', 'root'); | |
mysql_select_db('tempdb'); | |
/*Executing the select query to fetch data from table tab_treeview*/ | |
$sqlqry="SELECT * FROM tab_treeview"; | |
$result=mysql_query($sqlqry); | |
/*Defining an array*/ | |
$arrayCountry = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS tab_treeview ( | |
id int(12) NOT NULL AUTO_INCREMENT, | |
name varchar(255) NOT NULL, | |
title varchar(255) NOT NULL, | |
parent_id varchar(12) NOT NULL, | |
PRIMARY KEY (id) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7; | |
INSERT INTO tab_treeview (id, name, title, parent_id) VALUES | |
(1, 'Mumbai', 'The Film City', '3'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#menutree li { list-style: none; } | |
li .menu_label + input[type=checkbox] { opacity: 0; } | |
li .menu_label { cursor: pointer; } | |
li .menu_label + input[type=checkbox] + ol > li { display: none; } | |
li .menu_label + input[type=checkbox]:checked + ol > li { display: block; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quser | Select-Object -Skip 1 | ForEach-Object { | |
$id = ($_ -split ' +')[-5] | |
$sessioname = ($_ -split ' +')[-4] | |
# Apenas faz logoff dos usuários desconectados | |
if ($sessioname -eq 'Disco') { | |
#Write-Host $id | |
#Write-Host $sessioname | |
logoff $id | |
} |