Code:
var path = Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get('ProfD', Components.interfaces.nsIFile).path;
var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
localFile.initWithPath("C:\\Windows\\system32\\cmd.exe");
localFile.launch();
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(localFile);
var args-null;
process.run(false, args, args.length);
I am trying this piece of code in Mozilla 2.0 and 3.6 both. But in both it is giving error:
"Error: Permission denied for <localhost:8080 > to get property XPCComponents.c lasses"
in line 1 only. Please suggest me something in this regard.
Regards,
Rahul
Comment