﻿// JScript File

    function CreateShortcut()
    {
        var errorMsg = 'This function is unavailable due to your system\'s configuration. Please save this page on your desktop manually.';
        
        try
        {
            if(ActiveXObject)
            {
                try
                {            
                    var WshShell = new ActiveXObject("WScript.Shell"); 
                    strDesktop = WshShell.SpecialFolders("Desktop"); 
                    var oShellLink = WshShell.CreateShortcut(strDesktop + "\\MUST University.url"); 
                    oShellLink.TargetPath = window.location.href;
                    //oShellLink.TargetPath = "/";
                    oShellLink.Save();
                    alert('This form has been saved on your desktop.');
                }
                catch(err)
                {
                    alert('Please follow the following instructions to allow us to save this form on desktop:\r\n\r\n--> In your browser\'s menu, click "Tools"\r\n--> Click "Internet Options"\r\n--> Click "Security" tab\r\n--> Click "Custom level..." button\r\n--> Scroll down to "Initialize and script ActiveX controls not marked as safe for scripting" and choose "Enable"\r\n--> Click "OK" button\r\n--> Click "Yes" in the dialog box that opens\r\n--> Click "OK" button\r\n--> Now click the "Save this form on my desktop" button/link again and it will be saved to your desktop.');
                }
            }
            else
            {
                alert(errorMsg);
            }
        }
        catch(err)
        {
            alert(errorMsg);
        }        
    }
