Skip to content

Instantly share code, notes, and snippets.

@regeter
regeter / InstallRestartService.vbs
Created September 11, 2012 14:44
Script that installs WMI Event consumer to restart a windows service on resume
' Reto Egeter, fullparam.wordpress.com, Feb 2012
' Streamlined process. Installs correctly for x86, x64 and sandboxed 6432WOW.
Set wShe = CreateObject("WScript.Shell")
DebugMode = True
'No Security Warnings
set oEnv = wShe.Environment("PROCESS")
oEnv("SEE_MASK_NOZONECHECKS") = 1 'This prevent Security Zone checking for the period of execution.
@regeter
regeter / Search All.sql
Last active May 13, 2024 09:43
Search All Tables, All Columns
/* Reto Egeter, fullparam.wordpress.com */
DECLARE @SearchStrTableName nvarchar(255), @SearchStrColumnName nvarchar(255), @SearchStrColumnValue nvarchar(255), @SearchStrInXML bit, @FullRowResult bit, @FullRowResultRows int
SET @SearchStrColumnValue = '%searchthis%' /* use LIKE syntax */
SET @FullRowResult = 1
SET @FullRowResultRows = 3
SET @SearchStrTableName = NULL /* NULL for all tables, uses LIKE syntax */
SET @SearchStrColumnName = NULL /* NULL for all columns, uses LIKE syntax */
SET @SearchStrInXML = 0 /* Searching XML data may be slow */