7-Zip Command Lines (Windows)

To extract all .zip files in the specified directory and make a new folder in the current directory for the extract that has the same name as the .zip file:

  • D:Unzipped>”c:Program Files7-Zip7z.exe” x d:Zips*.zip -o*
Archive a folder
  • “C:Program Files7-Zip7z” a -tzip D:ZipsData_20100801.zip D:OutputData_20100801

Sequentially run all VB Script (.vbs) files in a directory

Create a new C# Console Application in Visual Studio and compile the code.  Copy the compiled .exe file to the directory containing the .vbs scripts you want to run in sequence.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
/*————————————————————————–
* Developer: Tom Gee
* Date: April 6, 2010
* Description: This .exe file will run every .VBS file in the same directory
*              as the .exe, but will wait for the current .VBS script to end
*              before beginning the next.
————————————————————————–*/
namespace RunAllVBSinDirectory
{
class Program
{
static void Main(string[] args)
{
try
{
string[] scripts = Directory.GetFiles(Directory.GetCurrentDirectory(), “*.vbs”);
int i = 0;
foreach (string script in scripts)
{
i++;
Console.WriteLine(“Running: ” + script);
using (Process exeProcess = Process.Start(script))
{
exeProcess.WaitForExit();
exeProcess.Close();
exeProcess.Dispose();
}
}
Console.WriteLine(“Ran all ” + i + ” script files in current directory (” + Directory.GetCurrentDirectory() + “)“);
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine(“ERROR! ” + ex.Message + Environment.NewLine + “Inner Exception: ” + ex.InnerException + Environment.NewLine + “Stack Trace: ” + ex.StackTrace);
Console.ReadLine();
}
}
}
}