Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Shortcuts to URLs
If the shortcut is to a URL instead of a standard .EXE the ShortCutEdit() function can't seem to read the Target as it is now called Target URL.
Anyone know how to make ShortCutInfo() read the Target URL: ?
WshShell = CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") oUrlLink = WshShell.CreateShortcut(StrCat(strDesktop , "\Microsoft Web Site.url")) oUrlLink.TargetPath = "http://www.microsoft.com" oUrlLink.Save oUrlLink = 0 WshShell = 0URL shortcuts are not real shortcuts.
They are INI files.
Really shortCutmake was designed to create shortcuts for files or directories. If you want to create an 'Internet shortcut' try the following code:
IniWritePvt ("InternetShortcut", "URL", "http://techsupt.winbatch.com", "C:\Windows\desktop\Internet.URL")
I am using the following code:
ShortcutExtra("Help Desk.URL", "", "", "%dir%help.ico", "0")
Let me know if you have any ideas.
The shortcuts functions are not designed for the file type URL (Internet shortcut).
It should be able to be done as follows: You could 'INI' write the following lines to the 'URL' file
Content of URL file..... ------------------------ [InternetShortcut] URL=http://172.21.36.97/c3.nsf IconFile=i:\apps\help\help.ico IconIndex=0 Modified=20128462C7D2BE0170
I am not sure exactly what the 'modified' line does, but this is what gets written to the URL file when I manually changed the icon via the "properties" dialog for the internet shortcut.
There may also be the issue of forcing the 'INI' updates to disk. We have found that a single IniWritePvt with blank strings forces the update to disk.
IniWritePvt("","","","%cd%\Help Desk.URL")
Your code would look some like the following:
;Content of URL file ;------------------- ;[InternetShortcut] ;URL=http://www.yahoo.com/ ;IconFile=D:\Backups\CSource\02_24_99\MAPI2\MFETCH\GRAYCAT.ICO ;IconIndex=0 ;Modified=20128462C7D2BE0170 IniWritePvt ("InternetShortcut", "URL", "http://www.yahoo.com/", "c:\Windows\desktop\test.URL") IniWritePvt ("InternetShortcut", "IconFile", "D:\Backups\CSource\02_24_99\MAPI2\MFETCH\GRAYCAT.ICO", "c:\Windows\desktop\test.URL") IniWritePvt ("InternetShortcut", "IconIndex", "0", "c:\Windows\desktop\test.URL") IniWritePvt ("InternetShortcut", "Modified", "20128462C7D2BE0170", "c:\Windows\desktop\test.URL") ;For good measure (force updates to disk) IniWritePvt ("", "", "", "c:\Windows\desktop\test.URL") exit
Article ID: W13857Filename: Shortcuts to URLs.txtFile Created: 2017:08:29:11:19:22Last Updated: 2017:08:29:11:19:22