Skip to content

Instantly share code, notes, and snippets.

@tdmitch
Created December 16, 2016 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdmitch/2f75e96a3fadc2304a847f2b128832bf to your computer and use it in GitHub Desktop.
Save tdmitch/2f75e96a3fadc2304a847f2b128832bf to your computer and use it in GitHub Desktop.
// Store the SSIS variables in local C# variables
string exeName = Dts.Variables["$Package::pPathTo7zip"].Value.ToString();
string src = Dts.Variables["$Package::pSource"].Value.ToString();
string dst = Dts.Variables["$Package::pDest"].Value.ToString();
// Create args string
string args = " -y"; // Answer Y to any prompt
args += " x"; // Extract
args += " " + "\"" + src + "\" -o\"" + dst + "\""; // Set source and dest
// Variable to capture exception message if any
string exceptionTxt = "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment