Compress/zip files from the command line in Windows 7?

In Windows 7 is there a native way to compress or zip files from the command line?  I'd like to do it without installing any third-party utilities such as 7Zip.

I fully agree that Compact is not the answer. There are additional concerns with the Compact command. It enables disk compression which is a total no-no. Very bad! It makes your computer very slow and is quite difficult to undo. The only time anyone should
use this command is when they're removing disk compression because someone turned it on to save space.  Turning this off has to be done by booting into the recovery console, if my memory serves me correctly, and it's a real nuisance.  So
definitely no to the Compact command.
If you wanted to compress files before sending them to another drive, or over a network, or by email, then Compact wouldn't actually help at all because the files have to get uncompressed whenever they're accessed, especially before sending them anywhere. 
When I say accessed, I mean that just looking at a file triggers the OS to decompress it in the background and present you with an uncompressed version of it then letting you change it and recompressing it again for storage every single time you access the
file, which is why your machine gets slower.  If you have folders or files that have blue text instead of black, then you've probably already made this mistake.
I would also like to know if there is a built-in command for zipping files/directories, or, if there isn't such a thing built into Windows, then I would like to know if this is feature is accessible through Visual Studio, which would be just as good as having
a command-line program for those of us that do a bit of programming.
If anyone knows if MS provides such a feature, either by command-line or through an API, then I'd love to hear about it.  Good luck to those of you that have disk compression turn on.

Similar Messages

  • Get the absolute path and filename of the file from the command line

    Hi,
    when we run the class we give the command
    java <filename>
    How can I capture the filename given above and get its absolute path inside the
    public static void main(String [] args){}
    args[0] gives me the command line argument after the filename. How do I capture the filename itself from the command line argument and also get that files absolute path
    Thanks

    I don't know of any way to capture the java command input, but there are ways to find out where the application is being run from. (the "absolute path")
    http://forum.java.sun.com/thread.jsp?forum=31&thread=335394

  • Run javascript (not in a jsx file) from the command line extendscript

    Hi all,
    I was wondering if anyone knew how to run javascript from the command line in Extendscript (meaning Extendscript would be the target application). I know about the -run command line flag in which allows you to run a .jsx script from the command line but what I'm looking for similar syntax to run a script directly without needing to put it in a file. For example I have tried (obviously unsuccessfully):
    C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe -run "alert('Hello World');"
    Thanks!

    You might be looking for something like this: javascript - Is it possible to execute JSX scripts from outside ExtendScript? - Stack Overflow
    Although that one is about executing JSX files, the solutions given (Applescript as well as COM/VBScript) can be adapted to simply run a javascript code snippet rather than JSX file because the solutions simply call the Adobe app's Applescript/COM API to "execute javascript" (actually execute ExtendScript technically), and in the solution, they using includes to pull in the JSX file. You'd simply replace the include with actual javascript code snippet inserted in.
    Though this would then require you to run a VBScript, Applescript, or other script (that calls the COM/Applescript API) rather than the ESTK command line option.

  • Running jar files from the command line

    I have always felt it would be useful to run a jar file from th command line in EXACTLY the same way as an EXE. On some systems, typing MYAPP.JAR will run the app, but doesn't output and command line data, so it only works for GUI apps. I've come up with a tiny C program that runs java -jar xxxx.jar for you.
    #include <stdio.h>
    #include <string.h>
    #include <process.h>
    void main(int argc,char *argv[])
         char cmd[1024];
         strcpy(cmd,"java -jar ");
         strcat(cmd,argv[0]);
         strcat(cmd,".jar");
         for(int arg=1;arg<argc;arg++)
              strcat(cmd," ");
              strcat(cmd,argv[arg]);
         system(cmd);
    }Simply compile this to an exe, rename the exe to the name of your jar file and put it in the same directory. Then just type 'MyJarFile' (no jar extension) and it should run. It passes all command live args as well. Comments ?

    Here's a better version. The JAR and the EXE can be anywhere in the PATH:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <process.h>
    void main(int argc,char *argv[])
         char jar[1024];
         char cmd[1024];
         strcpy(cmd,argv[0]);
         strcat(cmd,".jar");
         _searchenv(cmd,"PATH",jar);
         strcpy(cmd,"java -jar ");
         strcat(cmd,jar);
         for(int arg=1;arg<argc;arg++)
              strcat(cmd," ");
              strcat(cmd,argv[arg]);
         system(cmd);
    }

  • How I can set my default browser mozilla firefox from the command line in Windows 7?

    I need to set my default browser mozilla firefox from the command line, ie without using the GUI.

    '''-setDefaultBrowser''' is the correct command - you need the two capital letters.
    Why Firefox 17.0.1? You would be missing a number of important security updates. Firefox 17.0.'''9''' is the current ESR release version.

  • Removing a cs5 extension from the command line on Windows broken ?

    On Windows
    "Adobe Extension Manager CS5.exe" -suppress  -remove product="Dreamweaver CS5" extension="Sample"
    does not work. MacOS similar cmd line works fine. The process always exits with a non-zero status. If I run w/o -suppress the GUI for Extension Mgr
    shows up w/o actually removing the extension on Windows!
    Is this a known bug ? Any workaround to uninstalling an extension from command line on Windows ?

    I just found out how. Thanks!

  • How do I create an AppleDouble "dot-underscore" file from the command line?

    We're going through a process of migrating NetWare shares to Windows shares (without File Services for Macintosh) where I work. One concern is that the NetWare shares are shared as AFP volumes to the Macs. All the finder info and metadata for the files is thus stored natively and invisible to all the servers involved in the migration. If the Novel migrator or robocopy copy the files, resource forks and metadata are lost.
    The procedure I've provided the migration team involves making a UFS disk image, identifying files on the NetWare share that have Mac resource forks or metadata, copying the files from NetWare to the image one-by-one (whereby the OS creates the AppleDouble dot-underscore files), and then copying the dot-underscore files back to the NetWare share so that when either migration tool is used, the files correctly appear on the Windows shares in AppleDouble form with forks and metadata intact. This works reliably enough, but it involves a HUGE amount of network activity, and there's issues with making sure that the permissions are correct in the process.
    Is there a way to directly produce the AppleDouble dot-underscore file from a file on an AFP share. Things like SplitForks, RezWhack, etc. don't work on shares. I cannot find any command-line utility, AppleScript extension, Automator action, etc. to do it.

    Thank you. I am aware of that, cpio as well. The problem is that I don't want to have to copy the files, just create the dot-underscore file. For various reasons, we still need to use the Windows-based migration tools to migrate the files. So what I want is something that can read the metadata and resource fork WITHOUT making a copy of the file to produce the dot-underscore file. The solution I
    currently have for them works like tar (without the extra step of storing things in the archive or requirement of using OS X tar to unpack it).

  • How do I run a 10g rep file from the command line, send output to previewer

    Hi Everyone,
    We are migrating from Reports 2.5 to 10g.
    We are creating a batch file to run one of our reports that is in the .rep file format. Can you tell us what we need to put in the batch file to run the report as a paper report and have the reports runtime prompt the user for the login and show the report in the previewer just like in Reports 2.5?
    Thanks.
    Emad

    They should take a look at the "Oracle Application Server - Reports Services - Publishing Reports to the Web" from Application Server Doumentation downloadable from Reports Homepage http://otn.oracle.com/products/reports
    Martin

  • I would like to open an .htm file from the command line using firefox. Firefox responds by trying to open a URL (adding WWW to front of file name)

    firefox is located on unix box and I would like to use it to open report generated. After script creats report I would like to call firefox to read report. "firefox report.htm"

    I have solved this problem. All I needed was to follow firefox with the filename

  • Can't send files to Trash from the command line

    Hello,
    as I'm programming in JAVA I must do all "special" operations as from the command line.
    I found several solutions but they don't work for me, at least not in Mavericks.
    I tried:
    osascript -e "tell app \"Finder\" to delete POSIX file \"/Users/me/totrash\""
    I got:
    21:60: execution error: Finder got an error: Handler can’t handle objects of this class. (-10010)
    I tried:
    echo "tell application \"Finder\" move POSIX file \"/Users/me/totrash\" to trash end tell | osascript
    I got:
    26:30: syntax error: Expected end of line but found command name. (-2741)
    Is there any working AppleScript way to send a file to the Trash Bin?
    Thanks in advance.
    ;JOOP!

    Near ....... I did not misspell 'me', I was in a different directory after all my experimenting .....
    Curse those who write cryptic error messages ...
    Bless those who still get it.
    So, thanks.
    ;JOOP!

  • Jar file runs from the command line, but not when I double click it

    Hello, I'm running windows xp. I've created an executable jar file and it runs fine from the command line when I type;
    java -jar wizard.jar
    but, when I double click it . . . nothing.
    Any ideas?

    nothing ? that's weird, windows XP should prompt you to select the program you want to use in order to open Jar files (and give you this silly piece of advice to search the web for the appropriate program)
    you might want to check what program (if any) got associated with .jar extensions :
    in Windows Explorer : Tools => Folder Options => File Types
    hth

  • Is there a way to switch between workspaces in Spaces from the command line?  I want to write a script to set up certain applications in certain workspaces (without having to do it manually each time)...

    Is there a way to switch between workspaces in Spaces from the comnand line?  I use several workspaces from Spaces, each workspace having a certain number of fixed applications running.  Rather than set all this up each time I log on, I'd like to write a script from the command line (I use gawk) to automate this. Currently I have a gawk script that, given a directory, opens a few xterms whose working directory is the given directory, and opens "preview" applied to a certain file in that directory.  However, at present I have to manually move an xterm through each workspace and run my gawk script in each workspace (applied to each directory that I'm working on).
    There must be a better way...

    Addendum: Can this be done via:   open -a Spaces --args xxx  , where xxx is some set of arguments (or something like this)?

  • Help required - running a Java program from the command line

    Hi,
    I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
    When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
    Both the application jar file and the external jar file are in my root directory (C:\).
    My command line call is as follows:
    java -cp c:MyExternalLib.jar -jar MyApp.jar
    Any help greatly appreciated.
    Thanks,
    Walter

    hi,
    set classpath=%classpath%;c:\myjar.jar;
    here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
    java mypgm
    this will solve ur problem
    regards,
    Ganesh

  • Problem with running a java program from the command line

    I have this code:
    package pkg;
    import jxl.*;
    import java.io.File;
    public class TestClass {
         public static void main(String[] args) {
              try{
                   Workbook book = Workbook.getWorkbook(new File("d:/testWorkspace/excFile.xls"));
                   Sheet sheet = book.getSheet(0);
                   String s=sheet.getCell(4, 2).getContents();
                   System.out.println(s);     
              }catch (Exception e){System.err.println(e);}
    }I've wrote it in Eclipse, added jxl.jar to the buildpath, and it works fine.
    Then I tried to run it from the command line and I did it like this:
    D:\testWorkspace\testProject\bin> java -cp \jxl.jar pkg.TestClassThe result was:
    Exception in thread "main" java.lang.NoClassDefFoundError: pkg/TestClass
    Caused by: java.lang.ClassNotFoundException: pkg.TestClass
    ...but the file TestClass.class DOES exist in the folder d:\testWorkspace\testProject\bin\pkg\ and the file jxl.jar IS on the root of drive D (like I already wrote, it worked fine inside the Eclipse).
    So, my question is: How to run this code from the command line?
    I have no idea what went wrong.
    Can someone help me, please?

    The current directory is not implied in the classpath.
    D:\testWorkspace\testProject\bin> java -cp .;d:\ pkg.TestClassor
    D:\testWorkspace\testProject\bin> java -cp .;d:\jxl.jar pkg.TestClassI always forget which is right since I never work with jars...

  • How to burn CD's from the command line in 2009?

    I've always managed to burn CDs and DVDs from the command line but I haven't done it in a long time. cdrecord wasn't working as root and I noticed it was just a symlink pointing to wodim.
    I tried the following command as root in a directory with some wav files:
    # cdrecord -dev=/dev/sr0 -driveropts=burnfree -audio -pad *.wav
    Which gives me:
    Mar 6 08:43:18 wilco ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
    Mar 6 08:43:18 wilco ata7.00: cmd a0/00:00:00:00:00/00:00:00:00:00/a0 tag 0
    Mar 6 08:43:18 wilco cdb 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Mar 6 08:43:18 wilco res 40/00:02:00:0c:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
    Mar 6 08:43:18 wilco ata7.00: status: { DRDY }
    Mar 6 08:43:18 wilco ata7: hard resetting link
    Mar 6 08:43:19 wilco ata7: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    Mar 6 08:43:19 wilco ata7.00: configured for UDMA/100
    Mar 6 08:43:19 wilco ata7: EH complete
    This worked for me in 2008, so has anything big changed?

    Rasi wrote:
    Wilco wrote:
    Dieter@be wrote:I did not follow the discussion, but I just use wodim as specified on http://wiki.archlinux.org/index.php/CD_Burning_Tips, and that works great for me.
    Hmm strange, I tried the same command as in my first post and it works fine with the real cdrtools but not with wodim (I also tried k3b and that failed too). So I just stick with cdrtools
    Hooray, one more convert
    I haven't really followed the discussion either but why choose an "emulated cdrecord" that doesn't work instead of the real program that works great?

Maybe you are looking for