Re: Executing a command line, stuck.
[email protected] (Baavgai) 31 Dec 2002 13:01:19 -0800
| Newsgroups | gmane.comp.mozilla.devel.xpcom |
|---|---|
| Organization | http://groups.google.com/ |
| Message-ID | <[email protected]> |
Perhaps the example was bad enough that the point of the question was
missed?
I need to execute a command line. That is, a program and a series of
arguments.
examples would include:
textpad.exe readme.txt
zip -ex %mozdir%\profile c:\profile_back.zip
A code snippet is what I'm hoping for here, I can read the online IDLs
just fine. ;) I feel there must be someone who knows how to do this.
By way of example, here is the code that can be used to execute a
program with no arguments.
function runProgram(fullPath) {
var oLocalFile = getLocalFile();
oLocalFile.initWithPath(fullPath);
oLocalFile.launch();
}
function getLocalFile() {
var className = "@mozilla.org/file/local;1";
var svc = Components.interfaces.nsILocalFile;
return Components.classes[className].createInstance(svc);
}
Thanks in advance for any help.