/BatchScriptReference

My Collection of Batch Script Snippets

Primary LanguageBatchfileMIT LicenseMIT

BatchScriptReference

A Home for Snippets of all the Batch Scripts I made over Time.

Useful Links

Table of Contents

AdminCheck.cmd

Script that checks if it was started with Admin Privileges.

Arguments.cmd

Pass Arguments to the Batch Script and save them in Variables.

FindFilesThatContain.cmd

Query all files in a Folder and check if they contain a certain Searchterm.

FOR_LOOP.cmd

Single and Multi Line FOR LOOP Snippets and a List Declaration.

IF_ELSE.cmd

Single and Multi Line IF ELSE Snippets and GOTO calls.

LocalDateTimeWmic.cmd

Get the current Date and Time from WMIC and create a formatted String from it to use for Console Output, Folder- and Filenames etc.

PythonRelativePath.cmd

Call a Python Script from a Path relative to the Batch Script using a Python Executable from a Path relative to the Batch Script.

SqlBackupDatabase.cmd

Create a Backup of an Sql Server Database.

SqlRestoreDatabase.cmd

Restore an Sql Server Database from a Backup File.

WindowsBackupHarddrive.cmd

Create a Backup of a Drive on your Windows Computer.

WindowsEventLogsExport.cmd

Export the Windows Event Logs from a specified Timeframe.