how to unzip rar files which are in remote server

2019-09-09 21:30发布

问题:

I have .rar files in network folder and I need to unzip rar files and store as .bak files into remote server. I have used execute process task and passed expressions but when I am executing task getting error as The process exit code was "2" while the expected was "0".

I have googled the error but did not find how to fix this. Please can anyone suggest me how to do this.

Below are the expressions I used

Executable : C:\Program Files\7-Zip\7z.exe

Arguments : x \\NETWORK-SQLBACKUP\ACCOUNTS\Monthly\CustomerDB\CustomerDB_backup_2015_08_31_203001_4545366.rar -o\\SDL-VR-DBSBACKUP\F:\Monthly bak files\CustomerDB_backup_2015_08_31_203001_4545366

Thanks.

回答1:

7zip, error code 2 means 'fatal error'. You may need to wrap the output file in quotation marks because it contains spaces. A good way to test it is running it from the command line manually and make sure it works, once you are happy with the result you can try it from a SSIS task.:

"C:\Program Files\7-Zip\7z.exe" x \\NETWORK-SQLBACKUP\ACCOUNTS\Monthly\CustomerDB\CustomerDB_backup_2015_08_31_203001_4545366.rar -o"\\SDL-VR-DBSBACKUP\F:\Monthly bak files\CustomerDB_backup_2015_08_31_203001_4545366"



标签: ssis