Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Completely OT, but you guys are clever
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 21st October 04:51
grant wagner
External User
 
Posts: 1
Default Completely OT, but you guys are clever



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 <gwagner@agricoreunited.com>
  Reply With Quote


 


Reply


Thread Tools
Display Modes




666