run a dos command via script task
I am trying to unzip a file using Execute Process task but everytime
I execute my application, a new window explorer gets open with source specific path defined in WinZip.
I Jus want to execeute Process Task with unzipping the file and avoid this explorer window to get open.
Please suggest a solution.
I have tried performing with Execute Process Task and Script Task, in both the options I am facing the same issue
(a new explorer window get open) this instance remains open. I want this explorer instance not get generated.
1st Method: Execute Process Task Expression Parameters:
winzip32 -min -e -stestpassword ProductInfo.zip ProductInfo.txt
1. Arguments: "-min -e -s" + @[User::varPkgZipFilePassword] + " " + @[User::varPkgCurrentProductLineFileName]
2. Executable: @[User::varPkgZipExecutableLocation]
3. WorkingDirectory: @[User::varPkgSourceFilePath]
2nd Method: Scritp Task code snippet sa follows:
Public Class ScriptMain
Public Sub Main()
Dim varCmdStr As String = Dts.Variables("varPkgZipExecutableLocation").Value.ToString() + " -min -e -s" + _
Dts.Variables("varPkgZipFilePassword").Value.ToString() +
" " + _
Dts.Variables("varPkgCurrentProductLineFileName").Value.ToString()
+ " " + _
Dts.Variables("varPkgSourceFilePath").Value.ToString()
MsgBox(varCmdStr)
Shell(varCmdStr, AppWinStyle.Hide, True)
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
March 28th, 2011 8:14pm
AFAIK winzip32is a GUI app, so you get the window. Use a different utility or its command line counterpart and you will be all set.
An example using 7zip:
http://www.ssisguru.com/2009/10/unzip-and-zip-files-using-ssis.html
Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2011 8:27pm
If you want to unzip via a Script Task it's better (personal opinion) to use the Visual J# Redistributable Packages:
http://microsoft-ssis.blogspot.com/2011/01/unzip-files-with-ssis.html
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
March 28th, 2011 8:40pm
In the Execute Process Task, change the window style to hidden.
<img src="http://lookpic.com/c1/i2/2485/hFeZc6EI.jpeg"></img>
Chaos, Disorder and Panic ... my work is done here!
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2011 8:28am
Previously while development we used 7z only, we need to change in to winzip, because as per our company policy we should not use 7z
March 29th, 2011 8:34am