Black
30-10-2002, 10.18.57
Ciao a tutti spero mi possiate aiutare con questo dilemma.
Devo, al click su un link creare sul desktop una icona.
Ho creato un file chiamato CreaIcona.js che contiene queste istruzioni:
var WshShell = WScript.CreateObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\Shortcut Script.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Script";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
Questo file se lanciato da Gestione Risorse crea l'icona correttamente ma non riesco ad associarlo all'onclick di un href.
io in pratica faccio cosė
<HTML>
<HEAD>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function AddIcona(){
var WshShell = WScript.CreateObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\Shortcut Script.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Script";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<A href=javascript:AddIcona()>Crea Icona sul desktop</A></FONT>
</BODY>
</HTML>
ma al click del link mi dice che WScript non č definito :rolleyes:
Potete aiutarmi per favore :(
Devo, al click su un link creare sul desktop una icona.
Ho creato un file chiamato CreaIcona.js che contiene queste istruzioni:
var WshShell = WScript.CreateObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\Shortcut Script.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Script";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
Questo file se lanciato da Gestione Risorse crea l'icona correttamente ma non riesco ad associarlo all'onclick di un href.
io in pratica faccio cosė
<HTML>
<HEAD>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function AddIcona(){
var WshShell = WScript.CreateObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\Shortcut Script.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Script";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<A href=javascript:AddIcona()>Crea Icona sul desktop</A></FONT>
</BODY>
</HTML>
ma al click del link mi dice che WScript non č definito :rolleyes:
Potete aiutarmi per favore :(