Completely OT, but you guys are clever

?

-

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 : )
 
K

Kenny Mann

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

--Kenny Mann
 
?

-

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%.
 
G

Grant Wagner

- said:
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".
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top