Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Compress files

Author  Topic 

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-04 : 06:56:57
HI Guys, one of our servers does not have WinZip (go figure). I need to compress a file that is created on that server. I understand Windows has a Compression command.

I serached this site and found no samples. I Googled it and followed their example but the file did not Zip.
COMPACT P:\data\TestFile.txt /C

Any suggestions?



spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-08-04 : 07:45:52
moved from script library.

compact does not create a zip file. windoes don't really have a command line for zip so you'll have to install the winzip on the server

you may try to use COMPRESS but you have to install the win 2k3 resource kit for it:
http://www.microsoft.com/downloads/details.aspx?familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2008-08-04 : 15:39:01
also, winzip does not really contain a commmand line version in the main installation. you will need to install the winzip command line add-on to get this functionality.

you may want to look at using other packages instead of winzip since it is shareware. I have used 7-zip in the past with success - and it contains both a gui and command line version in one package. It also supports just about every compression scheme under the sun including zip. best of all it is free open source software.

http://www.7-zip.org/



-ec
Go to Top of Page

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-05 : 08:10:20
Thanks Guys for the feedback but I do not have admin rights and thus cannot load software.
Does anyone know what the executable is for the 'Compressed (Zip) Folder' option under 'Send To' you get in the shortcut menu when you right click a filename? If you highlight a file and click it it will zip the file. There has got to be an exe for it somewhere in Windows. Not sure if it has command line options (probably not).

Any Ideas?
Thanks so much for responding.
Trudye

Go to Top of Page
   

- Advertisement -