ConsultingJoe Posted September 6, 2006 Posted September 6, 2006 (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 September 6, 2006 by zerocool60544 Check out ConsultingJoe.com
GaryFrost Posted September 6, 2006 Posted September 6, 2006 looks like it does the same thing as FileCreateShortcut SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
ConsultingJoe Posted September 6, 2006 Author Posted September 6, 2006 looks like it does the same thing as FileCreateShortcutLOL, I must have forgot there was such a function. OMG Check out ConsultingJoe.com
ConsultingJoe Posted September 6, 2006 Author Posted September 6, 2006 (edited) BTW: can anyone tell me how the create a .URL file rather than a normal .LNK file Edited September 6, 2006 by zerocool60544 Check out ConsultingJoe.com
MHz Posted September 6, 2006 Posted September 6, 2006 BTW: can anyone tell me how the create a .URL file rather than a normal .LNK fileHappen 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
Helge Posted September 6, 2006 Posted September 6, 2006 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
ConsultingJoe Posted September 6, 2006 Author Posted September 6, 2006 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 Check out ConsultingJoe.com
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now