JS创建快捷方式

<script language= "Jscript"> 
function createShortcutFile(title,URL){ 
var   fso,   ts; 
var   ForWriting=   2; 
fso   =   new   ActiveXObject("Scripting.FileSystemObject"); 
var   path= "C:\\Documents and Settings\\All Users\\桌面\\"+title+ ".url" ;
if(!fso.FileExists(path)){ 
ts   =   fso.OpenTextFile(path,   ForWriting,   true); 
ts.WriteLine( "[DEFAULT] "); 
ts.WriteLine( "BASEURL="+URL); 
ts.WriteLine( "[InternetShortcut] "); 
ts.WriteLine( "URL="+URL); 
}   else{ 
alert( "快捷方式存在! "); 
} 
} 
</script> 
<input type="button" onclick="createShortcutFile('JavaEye社区', 'http://www.iteye.com')" value="点击创建快捷方式" /> 

你可能感兴趣的:(C++,c,C#)