Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Uncompress File Through Cmd Shell

Posted on 2010-11-17
16
Medium Priority
?
1,116 Views
Last Modified: 2012-05-10
Hi all im using sql server 2000 and windows 2003 and i want to be able to uncompress a file using a cmd shell and wondered if anyone had the syntax to do this?
0
Comment
Question by:LBGUC04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
  • 3
16 Comments
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34154063
When you say uncomress a file....

Do you mean the file has the compress attribue assigned to it?

Is the file compressed with a third party tool?

Is the file in a windows compressed folder?
0
 
LVL 3

Expert Comment

by:Bogeholm
ID: 34154165
Try this VBScript:


http://www.robvanderwoude.com/vbstech_files_zip.php
Be sure to go to the "UNZIP with System.Shell Folder's CopyHere method", last on the page
0
 

Author Comment

by:LBGUC04
ID: 34154175
thank you for yoru response but this must be done using a sql statement
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34154189
If you already have the command then just use

EXEC xp_cmdshell N'COMMAND'

Open in new window

0
 

Author Comment

by:LBGUC04
ID: 34155302
I have tried the following but i just get an error

exec master..xp_cmdshell 'Extract "U:\TestExtract\test.zip","U:\TestExtract"'


Extract - Verity, Inc. Version 5.0.0 (_nti40, May 13 2003)
Usage: extract [-xnv] -credentials user[:password][:domain][:mailbox] basename collname [query]
0
 
LVL 3

Expert Comment

by:Bogeholm
ID: 34155437
Hi LBGUC04

The internal command EXTRACT is not capable of extracting a ZIP-archieve!

You could use the VBScript i posted earlier. It can be executed using cscript.exe

E.g: "cscript.exe unzip.vbs"
0
 

Author Comment

by:LBGUC04
ID: 34155465
I need to find a way to do this using sql code, i can esily compress a file so there must be a way to unompress
0
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34155511
Does the extract command that you ran inside of the xp_cmdshell work normally?
0
 

Author Comment

by:LBGUC04
ID: 34155514
i have never used it before i got it from the link above
0
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34155586
Could you answer my original questions please?
0
 

Author Comment

by:LBGUC04
ID: 34155632
i did

Does the extract command that you ran inside of the xp_cmdshell work normally?

What does this mean?

If i run exec master..xp_cmdshell 'Extract'

then i get this

Extract - Verity, Inc. Version 5.0.0 (_nti40, May 13 2003)
Usage: extract [-xnv] -credentials user[:password][:domain][:mailbox] basename collname [query]

0
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34155644
Sorry i waas refering to my first post.

When you say uncomress a file....

Do you mean the file has the compress attribue assigned to it?

Is the file compressed with a third party tool?

Is the file in a windows compressed folder?
0
 

Accepted Solution

by:
LBGUC04 earned 0 total points
ID: 34162363
Dotn worry i founf out how to do it using UNZIP in cmd shell
0
 
LVL 3

Expert Comment

by:Bogeholm
ID: 34162962
Hi LBGUC04,

Please share your solution :-)
0
 

Author Comment

by:LBGUC04
ID: 34163179
--Uncompress Files
declare @sql varchar(8000)
set @sql = 'exec master..xp_cmdshell ''UNZIP -j -o U:\TestExtract\test.zip -d U:\TestExtract'''

print @sql
exec (@SQL)
0
 

Author Closing Comment

by:LBGUC04
ID: 34186511
i have the answer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question