Sign in to follow this  
Followers 0
ConsultingJoe

Creating a Shortcut

7 posts in this topic

#1 ·  Posted (edited)

createshortcut("C:\link.lnk", "notepad.exe", 3, "Ctrl+Shift+F", "notepad.exe, 0", "This is notepad", "C:\windows")

Func createshortcut( $location, $target, $windowstyle = 1, $hotkey = "", $icon = 0, $description = "", $workingdirectory = "" )
$Shell = ObjCreate( "WScript.Shell" )
$link = $Shell.CreateShortcut($location)
$link.TargetPath = $target
$link.WindowStyle = $windowstyle
$link.Hotkey = $hotkey
$link.IconLocation = $icon
$link.Description = $description
$link.WorkingDirectory = $workingdirectory
$link.Save
EndFunc

Edited by zerocool60544

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites



looks like it does the same thing as FileCreateShortcut

LOL, I must have forgot there was such a function. OMG :P

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

BTW: can anyone tell me how the create a .URL file rather than a normal .LNK file

Edited by zerocool60544

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

BTW: can anyone tell me how the create a .URL file rather than a normal .LNK file

Happen to have one of the URL shortcut UDFs premade.

; Example of creating a Url shortcut

If _WshUrlShortcut(@DesktopDir & '\AutoIt3.url', 'http://www.autoitscript.com/autoit3') Then
    MsgBox(0, @ScriptName, 'Url shortcut created')
EndIf

Exit

Func _WshUrlShortcut($sFilePath, $sUrl)
    ; Creates a Url shortcut
    Local $oUrlLink, $oWshShell
    $oWshShell = ObjCreate("WScript.Shell")
    If Not @error Then
        $oUrlLink = $oWshShell.CreateShortcut($sFilePath)
        If IsObj($oUrlLink) Then
            $oUrlLink.TargetPath = $sUrl
            $oUrlLink.Save
            If FileExists($sFilePath) Then
                Return True
            EndIf
        EndIf
    EndIf
EndFunc

:P

Share this post


Link to post
Share on other sites

URL-files in my eyes looks extremely similar to the INI-format..

[DEFAULT]
BASEURL=http://www.autoitscript.com/forum/index.php?

[InternetShortcut]
URL=http://www.autoitscript.com/forum/index.php?
Modified=B0539DC5D1D1C601CE
IconFile=http://www.autoitscript.com/forum/favicon.ico
IconIndex=1

Share this post


Link to post
Share on other sites

well I figured it out, if you just write a file like this...

[InternetShortcut]
URL=www.yahoo.com

...And save it as *.url it works great


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0