Skip to content

Instantly share code, notes, and snippets.

@simply-coded
simply-coded / EachFolder.vbs
Last active September 29, 2017 22:09
Loops through all folders and subfolders under a root directory and runs them through a routine of your choice.
Function EachFolder(strRoot, includeRoot, funcRef, funcArgs, oFSO)
' @author: Jeremy England ( SimplyCoded )
' @description: Loops through all folders and subfolders under a root directory.
Dim oFolder, changeProtection
If oFSO.FolderExists(strRoot) Then
For Each oFolder In oFSO.GetFolder(strRoot).SubFolders
changeProtection = oFolder.Path
EachFolder = funcRef(oFolder, funcArgs)
If UCase(EachFolder) = "SKIP_ALL" Then Exit Function
If UCase(EachFolder) = "SKIP_PARENT" Then Exit For
@simply-coded
simply-coded / ArrayList.vbs
Created May 31, 2017 20:55
Use lists in VBScript.
'create an arraylist
Set list = CreateObject("System.Collections.ArrayList")
'add values
list.add "mike"
list.add "jeremy"
list.add "kate"
list.add "alice"
'add a bunch of values easily via custom sub
@simply-coded
simply-coded / RunAsAdmin.md
Last active May 4, 2023 21:39
Run the current VBScript file as an administrator.
@simply-coded
simply-coded / table.html
Last active June 21, 2017 14:46
REQUEST: HTML table code.
<!DOCTYPE html>
<html>
<head>
<style>
table {
background-color: #f2f2f2;
border: 5px solid cornflowerblue;
border-spacing: 10px;
font-family: Arial, Helvetica, sans-serif
}
@simply-coded
simply-coded / ListAvailableCOMs.hta
Last active October 31, 2016 18:56
Get available Component Object Models (COM)s on your computer, and view their members.
<!DOCTYPE html>
<!--
Authors: Jeremy England
Company: SimplyCoded
Revised: 10/31/2016
Description:
Gets a list of available COM objects on your computer.
Once populated, clicking on the COM name shows its members, as well as if it is vbscript compatible.
-->
@simply-coded
simply-coded / Disable_Wi-Fi.vbs
Last active May 17, 2023 04:32
Use VBScript to enable, disable, or toggle a connection like your Wi-Fi on and off.
'************************
'Name: Disable Connection
'Author: Jeremy England
'Company: SimplyCoded
'Date: 10/01/2016
'************************
Option Explicit
Dim interface, interfaceName, interfaceTarget, available, verb
'Pick the Interface Name you want to disable
@simply-coded
simply-coded / CreateExcelFile.vbs
Last active August 3, 2022 08:40
Use VBScript to create, open, and edit excel files. ( Excel needs to be installed on your computer ).
'Microsoft Excel Automation Basics
':: Create and edit an Excel File.
'---------------------------------
'create the excel object
Set objExcel = CreateObject("Excel.Application")
'view the excel program and file, set to false to hide the whole process
objExcel.Visible = True
@simply-coded
simply-coded / MsgStack.vbs
Last active October 3, 2022 19:42
Create multiple msgbox popups without waiting for a return value to continue.
Option Explicit
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim wsh : Set wsh = CreateObject("Wscript.Shell")
Dim args : Set args = WScript.Arguments
Dim this : this = WScript.ScriptFullName
Dim id, ans
'create message boxes
If args.count = 0 Then
@simply-coded
simply-coded / carousel-animations.js
Last active April 16, 2019 22:00
A JavaScript object that creates a simple carousel out of any element with the class "carousel". Has a section for adding animations in between slides.
@simply-coded
simply-coded / carousel-animations-demo.html
Last active May 24, 2016 03:16
Demo of my "carousel.js" and "carousel-animations.js" gists.