QB64 Phoenix Edition v3.2.1 Released!
#7
And apparently I had more than one version of this out there.

Code: (Select All)
Option _Explicit

If make_shortcut(_CWD$ + "\qb64.exe", "QB64 (x64) v1.5") Then
    Print "Shortcut has been created"
Else Print "Shortcut was not created. An error occurred"
End If

Function poshQ$ (arg As String)
    poshQ = "'" + Chr$(34) + arg + Chr$(34) + "'"
End Function

Function make_shortcut& (source As String, dest As String)
    Dim As Long exit_code
    Dim As String cmd
    cmd = "PowerShell -Command $SourceFileLocation = " + poshQ(source) + "; $ShortcutLocation = " + poshQ(_Dir$("desktop") + dest + ".lnk") + "; $WScriptShell = New-Object -ComObject WScript.Shell; $Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation); $Shortcut.TargetPath = $SourceFileLocation; if(!$Shortcut.Save()){exit -1} else{exit 0};"
    exit_code = _ShellHide(cmd)
    make_shortcut = exit_code
End Function
Ask me about Windows API and maybe some Linux stuff
Reply


Messages In This Thread
RE: QB64 Phoenix Edition v3.2.1 Released! - by SpriggsySpriggs - 09-27-2022, 07:37 PM



Users browsing this thread: 3 Guest(s)