Get the Current Script Directory in PowerShell, VBScript and Batch

Overview This post shows how to quickly get the current script directory using PowerShell, VBScript and Batch – the most commonly used scripting languages for...

PowerShell – Comparing Two Arrays

Find difference in two array $Array1=@("John","Mark") $Array2=@("Mike","Paul","Bill","John","Mark") $ArrayDiff=$Array2 | Where {$Array1 -NotContains $_} Find common in two array $Array1=@("John","Mark") $Array2=@("Mike","Paul","Bill","John","Mark") $ArrayDiff=$Array2 | Where {$Array1 -Contains $_}

PowerShell – Change Error Text And Warning Text Colors

How could such a nice tool have such a terrible choice of colors for errors and warnings? I am talking about the ISE and...

Update HKCU Registry from the System Account using PowerShell

If you want to Update HKCU Registry from the System Account for the current logged on user HKEY_USERS hive. Use the below code. I...

BatchFile – Script To Zip File

In this tutorial we will explain how you can create script to zip file using cmd command. 7zip is program that will use for zipping.  We...

Script to delete files older than 7 days

 Following our script series we will explain in this tutorial the way to create script to delete files older than 7 days. Will perform this operation using forfiles to...

Script to check disk space on multiple servers

Script to check disk space on multiple servers Download PSTool. Create script. Create Hostlist.txt Download PsInfo.exe and PsInfo64.exe from below Microsoft link. https://docs.microsoft.com/en-us/sysinternals/downloads/pstools 2. Copy the...