javascript 操作文件 实现方法小结(3)


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>用JavaScript创建快捷方式</TITLE>
<META CONTENT="EditPlus">
<META CONTENT="">
<META CONTENT="">
<META CONTENT="">
</HEAD>
<script language="javascript">
function createLink(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("WScript.Shell");
var tagFolder = "c:\\link";
if(!fso.FolderExists(tagFolder ))
{
fso.CreateFolder(tagFolder);
alert("Create success!");
}
if(!fso.FileExists(tagFolder + "\\eip.lnk"))
{
var link = shell.CreateShortcut(tagFolder + "\\eip.lnk");
link.Description = "打开一个程序的快捷方式";
link.TargetPath = "C:\\Program Files\\FlashFXP\\flashfxp.exe";
link.WindowStyle = 3;
link.WorkingDirectory = "C:\\Program Files\\FlashFXP";
link.Save();
}
}
</script>
<BODY>
<input type="button" value="click me"/>
</BODY>
</HTML>

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjwgyw.html