Jump to content

Problem with FileCreateShortcut() and certain urls


mike1950r
 Share

Go to solution Solved by mike1950r,

Recommended Posts

  • Developers

@mike1950rPlease stick to one topic! 

** Merged **

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Solution

Sorry to everybody for my confusion.

Infact the methode creating an internet shortcut i used was completely wrong.

Nevertheless it worked for most urls.

Anyway it must be another procedure like this:

Func FileCreateInternetShortcut($sUrl, $sFileName, $sWorkingDir, $sIcon)
    Local $bSuccess, $iSec, $sIni

    $bSuccess = False

    $sWorkingDir = StringRegExpReplace($sWorkingDir, "\\+\z", "") & "\"

    If FileExists($sWorkingDir) Then
        $sFileName = StringReplace($sFileName, ".url", "") & ".url"

        $sIni = $sWorkingDir & $sFileName
        $iSec = "InternetShortcut"
        $sUrl = StringRegExpReplace($sUrl, "^.*?:/+", "")

        IniWrite($sIni, $iSec, "URL", $sURL)
        IniWrite($sIni, $iSec, "IDList", "")
        IniWrite($sIni, $iSec, "IconFile", $sIcon)
        IniWrite($sIni, $iSec, "IconIndex", "")

        $bSuccess = True
    EndIf

    Return $bSuccess
EndFunc   ;==>FileCreateInternetShortcut

This is not created by me, I just modified it for my use.
It creates another type of file not the same like FileCreateShortcut does.
It accepts all Urls and creates the internet shortcuts like Internet Explorer does.
The icon part is for those, who download the icon first from the internet sites, like me.

Anyway, I want to thank everybody for assisting me and leaving me stealing their time.

Thanks again.

Cheers mike

☺️

Edited by mike1950r
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...