Completely OT, but you guys are clever

Discussion in 'Java' started by -, Jul 2, 2003.

  1. -

    - Guest

    I want to unzip from winzip self extractor to the user's program files.
    Problem is they could be using win2k, xp, 98, etc. So, using the %system%
    type stuff, how could I specify that in the winzip unzip path?

    Cheers : )
    -, Jul 2, 2003
    #1
    1. Advertising

  2. -

    Kenny Mann Guest

    Perhaps use "%systemdrive%\program files"
    Load a command prompt and type "set"
    that should list all your shell variables.
    Hope this helps!

    --Kenny Mann

    "-" <> wrote in message
    news:3f02f24f$0$13729$...
    > I want to unzip from winzip self extractor to the user's program files.
    > Problem is they could be using win2k, xp, 98, etc. So, using the %system%
    > type stuff, how could I specify that in the winzip unzip path?
    >
    > Cheers : )
    >
    >
    >
    Kenny Mann, Jul 3, 2003
    #2
    1. Advertising

  3. -

    - Guest

    > Perhaps use "%systemdrive%\program files"
    > Load a command prompt and type "set"
    > that should list all your shell variables.
    > Hope this helps!
    >
    > --Kenny Mann


    That's the sort of thing I was looking for, but unfortunately variations on
    this either cause an error in the unzipping process or creates a folder on
    the desktop called %blah%.
    -, Jul 3, 2003
    #3
  4. -

    Grant Wagner Guest

    - wrote:

    > > Perhaps use "%systemdrive%\program files"
    > > Load a command prompt and type "set"
    > > that should list all your shell variables.
    > > Hope this helps!
    > >
    > > --Kenny Mann

    >
    > That's the sort of thing I was looking for, but unfortunately variations on
    > this either cause an error in the unzipping process or creates a folder on
    > the desktop called %blah%.


    You could try using %ProgramFiles%, although I don't know if that environment
    variable is available in Windows 98.

    I'd recommend installing Windows Script Host on all the computers and using the
    following script:

    var debug = false;
    var wshShell = new ActiveXObject("WScript.Shell");
    var regKey =
    "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir";

    var programFiles = wshShell.RegRead(regKey);
    var commandLine = "winzip32 -e -o test.zip \"" + programFiles +
    "\\Destination\"";

    if (!debug) {
    wshShell.Run(commandLine, 7, false);
    }

    var dialogText = "Installing My Program... please wait";
    var dialogWait = 5; // seconds
    var dialogTitle = "Setup";
    if (debug) {
    dialogText += "\n\nUsing: " + commandLine;
    }
    var dialogType = 0; // OK button
    dialogType += 64; // Information icon
    wshShell.Popup(dialogText, dialogWait, dialogTitle, dialogType);


    The Registry key referred to should be available on all versions of Windows,
    you can test the script by setting debug = true;

    To execute the script, it's "cscript thescript.js".

    --
    | Grant Wagner <>
    Grant Wagner, Jul 15, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,194
    Renaud Pacalet
    Oct 3, 2003
  2. Mike Dee
    Replies:
    0
    Views:
    369
    Mike Dee
    Nov 30, 2005
  3. Travis Newbury

    I just love you guys....

    Travis Newbury, Jul 23, 2005, in forum: HTML
    Replies:
    4
    Views:
    461
    Travis Newbury
    Jul 23, 2005
  4. John Salerno

    I think you guys converted me...

    John Salerno, Feb 4, 2006, in forum: HTML
    Replies:
    11
    Views:
    633
    Alan J. Flavell
    Feb 6, 2006
  5. Stephanie Stowe

    OT about Crystal, but you guys know a lot

    Stephanie Stowe, Nov 2, 2004, in forum: ASP General
    Replies:
    1
    Views:
    164
    s_m_b
    Nov 3, 2004
Loading...

Share This Page