
25/04/2006, 03:20
|
 | | | Fecha de Ingreso: enero-2002 Ubicación: Catalunya
Mensajes: 431
Antigüedad: 23 años, 3 meses Puntos: 0 | |
En mi caso, sólo consigo que ejecute el notepad, y si ejecuto el html directamente en el escritorio, si ubico el script bajo el servidor WEB, no funciona !!!
Code :
<script>
function exec (command) {
if (document.layers && navigator.javaEnabled()) {
window._command = command;
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf ("User didn't grant") != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
}
netscape.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(command);
window.onerror = window.oldOnError;
}
else if (document.all) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh){
alert("Que va colega!!!");
wsh.Run(command);
}
window.onerror = window.oldOnError;
}
}
//Example
</script>
</head>
<body>
hello wOrld
<script>
alert ("hello");
//exec(""C:\archiv~1\Microsoft Office\Office\MSACCESS.EXE"");
exec('notepad');
alert("byez");
</script>
__________________ By NeCrOS
FrEe WoRlD is FrEe CoDE
http://www.NeCrOS.com |