用fso SpecialFolder 常数
仅当类型库包含以下常数定义,且在您的工程文件中已经显式引用该类型库后,才允许使用这些常数。对于 VBScript,必须在代码中显式声明这些常数。常数 值 描述 
WindowsFolder 0 Windows 文件夹,包含由 Windows 操作系统安装的文件。 
SystemFolder 1 System 文件夹,包含库、字体和设备驱动程序文件。 
TemporaryFolder 2 Temp 文件夹,用于保存临时文件。可在 TMP 环境变量中找到该文件夹的路径。 

解决方案 »

  1.   

    For Exam:<script language="Javascript">
      var WshShell = new ActiveXObject("WScript.Shell");
      var url="http://lucky.myrice.com";
      var title="【孟宪会之精彩世界】";
      WshShell.RegWrite ("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", url);
      window.status=WshShell.RegRead ("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page")
      var FavoritesPath = WshShell.SpecialFolders("Favorites");
      var oUrlLink = WshShell.CreateShortcut(FavoritesPath+'\\'+title+".lnk");
      oUrlLink.TargetPath = url;
      oUrlLink.Save();
      var DesktopPath = WshShell.SpecialFolders("Desktop");//返回桌面路径
      //alert(DesktopPath)
      //DesktopPath=DesktopPath.substring(0,DesktopPath.length-7)
      var MyShortcut = WshShell.CreateShortcut(DesktopPath + "\\" + title+ "的快捷方式.lnk");
      MyShortcut.TargetPath = url;
      MyShortcut.WindowStyle = 4;
      MyShortcut.IconLocation = WshShell.ExpandEnvironmentStrings("%windir%\\SYSTEM\\SHELL32.DLL,46");
      MyShortcut.Save();
    </script>
      

  2.   

    WshShell.ExpandEnvironmentStrings("%windir%)
      

  3.   

    在默认级别下不出安全提示的?可能不行吧。 不知到net_lover(孟子E章) 老大知不知到, 关注
      

  4.   

    恢复注册表:
    http://www.blueidea.com/user/qswh/reg.hta
    看当前系统路径
    <script>
    var wsh=new ActiveXObject("wscript.shell")document.write(wsh.SpecialFolders("AllUsersDesktop"))
    document.write(wsh.SpecialFolders("AllUsersStartMenu"))
    document.write(wsh.SpecialFolders("AllUsersPrograms"))
    document.write(wsh.SpecialFolders("AllUsersStartup"))
    document.write(wsh.SpecialFolders("Desktop"))
    document.write(wsh.SpecialFolders("Favorites"))
    document.write(wsh.SpecialFolders("Fonts"))
    document.write(wsh.SpecialFolders("MyDocuments"))
    document.write(wsh.SpecialFolders("NetHood"))
    document.write(wsh.SpecialFolders("PrintHood"))
    document.write(wsh.SpecialFolders("Programs"))
    document.write(wsh.SpecialFolders("Recent"))
    document.write(wsh.SpecialFolders("SendTo"))
    document.write(wsh.SpecialFolders("StartMenu"))
    document.write(wsh.SpecialFolders("Startup"))
    document.write(wsh.SpecialFolders("Templates"))
    </script>
      

  5.   

    谢谢 qiushuiwuhen(秋水无恨) ,可是还是要出安全提示框哦