Table of Contents
Code Snippets
Cycle through a List(of threads) to abort and remove from list
Get previous control
Update control via Delegate Invoke
Drive Map and UnMap
Text Output Functions (Colorizing for Console)
Get Icon for Extension
Convert to RGB
Hex to Color
Text Output (spacing)
Create Text as an Image on the fly and add to control
ToIcon function icon
Display and render an SVG file
Load Icons from a file (dll, exe, program, etc)
Console - Get Password with mask character
SQL - sGrabBetween (proc) (SubString)
SQL - sGrabBetween (function) (SubString)
Split String into n- number of characters per line
A Program is trying to Send an email on your Behalf
Outlook Version Reference
VBS - subSendEMail
PowerShell - Turn Off Monitor
PowerShell FTP and Send-ToEmail
VB.NET - Send Email
Restart Explorer Gracefully
Close a File Explorer window
Open Explorer to a specific folder/file
Create SecureString
Grab Between in String
Grab Between in String (C#)
Remove Special Chars from String (Example)
Find a string by using a Predicate (ie for String(Of) )
Read File Contents (Text) at once
Class clsClearHistories
Read an Event Viewer Key that is not the traditional, but in the Windows structure
Example of Working with the Event Logs
Read HKCU for info
Read Registry Keys
Quck Read of Registry (One liner)
Convert SID to User (sAMAccountName)
Convert User (sAMaccountName) to SID
CopyKey and RecurseCopyKey Registry Key copies
Focus on Textbox
Running program in Explorer (detect)
Command Line Arguments
Get Environment Variable easy
my.resources write file
Quit if already running
Console Cancel Key Press (CONTROL+C/Break)
Session Ending - Great with Control+C - Quit with Clean up
Unix Times (From, To, and Epoch)
Query Logged on users on a Server (query logon /server:..)
Uptime with PerformanceCounters
Is Port Open?
IP Check RegEx (VBscript)
Get MAC Address
IsDayTime Check time between two dates
Delay between then and now Pause if you will
Round to Quarter Hour
Get Day of Week as String
Remove List View items more completely
Get ContextMenu's Listview
Remove HTML characters from string
Get the first/latest file in a pattern from a folder/directory
Recursive Get all files in Folder structure
Restart AppPool
Active Directory - AD Group member Add/Remove, Other useful snippets for AD
Authenticate to AD and check Group Membership
Combobox convenience
Fill Combobox fast with a Adapter fill
Another way To add and remove AD groups. A simpler approach
Active Directory AD authentication in Classic ASP
Password Dialog box sample
Random Number Function in Range
Disk Info
Chart - Example
Chart - Target Point Label
Get Sizes (TB,GB,MB,KB,B)
Delete Folders/Files Recursively
Uptime for a server
Example of File Version comparison
Screen and Mouse Movement Mods
Run Remote Process (VBNet + WMI)
Start a process and wait for completion with time out
Make a form the TopLevel
Load a Font for the User Session from a Resource
Press Control key with a letter
Creating a MS-like fillable search bar
Using a Custom Caption
Custom web page and how to do mouse over
Flash Icon in Tray
Fill a SQL Adapter
ASP Get Image File from DB and Display in Browser
ASP Get Image HTML from DB and display in Browser
VB.Net Add Image to DB table
VB.Net Get Image from Table
VB.Net Get Image from Table (MySql)
VB.Net Add Image to DB Table (MySql)
Classic ASP repost Form data
Import binary file into a sql varbinary(max) column (VBScript)
Execute Stored Procedure in VBNet
TestSQL (MySql)
Parameter '@variable' must be defined
Services - Get State
Getting Service Start type
Passing arguments to a Windows Service
Get Service ImagePath and/or Display Name
Outlook Automation of PSTs and Stores
Outlook VSTO
Button click to manipulate current/active email
Ribbon Button click to manipulate current/active email
MailItem Events with Listeners
Sorting Outlook Emails into Subfolders
Send a fax (example of manipulating To line)
Example of going through all Recipients in ItemSend() method
Center for to Screen or Parent Window
Covert Spreadsheet (xls) to CSV at command line
MS Access on Task Scheduler
RDS Get Users (non RDP users)
Remove Domain Name (NetBIOS) dynamically
Ini File Manipulation
Classic ASP Show all form Items and Keys
Edit Cells in ListView
Add ComboBox to Listview
Change Color of ListView cell (ListItem)
Change Textbox to ComboBox with F3
Adding a ComboBox to a Column Header
Convert xls to csv in VBscript
Convert Day differences to decimal
JavaScript isValidDate (not exactly)
JavaScript isDate (between 1900-2100)
Close browser IE window when launching Chrome
reCatcha - HTML example
reCapthca - <BUTTON> validation Example
reCaptcha and RDGateway
WebFormSubmitter Class
jQuery require another field if radio button is clicked
Detect which Radiobutton is selected in a GroupBox
VBS AD Accounts Expire
ipsec example block ports
Is IP Internal (VB.Net)
Is IP Internal (C#)
event log watcher
Folder/File watcher...Open File watcher
Printing in VB.Net
Working with CSV/Tab characters
Turn off X, Min and Max in Console windows
Close Console Window (ie run in Forms mode)
Test if a user is in a group by using a SQL Stored Procedure
pdfinfo to get Page Count
Count Characters Function
Test Toast
A Nicer Toast when Balloons dont't work
Tooltip on a label (control)
Turn off Tabs in TabControl
Launching an App as a user account (context) from a Service
Check to see if a Process is running
List Processes For a Session ID
Kill Remote Process
Read Outlook Calendar with Outlook Redemption.dll
Encrypt and Decrypt text
Ribbon Fun
Dynamic Ribbon Tab - Form Closing
Copy tab page
Copy List View items
Drag and Drop (VBNet)
Get the file icon and display in Listview
Get Username for a process
Allow a Service to run as a Console program
Get JSON object
HTTPSession (web, produce file)
isDirty handler VBnet Control changed save
Dynamic Controls (on same thread)
Garbage Collection
PDF Manipulation and Creation
Rounded Corner Panel
MS Access Remove DBO prefix when import from ODBC
Linux Stuff
.bashrc (addition)
Find most recent modified files
Trim whitespace from BASH variable
PHP - Search File and Get Line Number
Init for CMD
Get Newest File from Command Line
Backup Profile Script for redundancy