Shortcuts to URLs
Keywords: Shortcuts to URLs
Question:
I am trying to read ShortCutInfo() and if necessary modify it using ShortCutEdit(). This has been working fine but now I've run into a new twist.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: ?
Answer:
URL shortcuts are not real shortcuts.They are INI files.
- Use IniReadPvt to read them.
- Be sure to include the .url extension on the ini file name.
- Looking at the shortcut in a console window will help you figure out what is going on.
- Try the TYPE command on it.
Question 2:
I am attempting to specify a URL as a target, with ShortcutMake. However, It doesn't seem to create a valid shortcut. Somehow c:\ is getting concatenated to the beginning. Any Thoughts?Answer 2:
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.windowware.com", "C:\Windows\desktop\Internet.URL")Question 3:
I am getting an error on the ShortcutExtra function, (which is no surprise after what I've learned). The only thing is, I am unsure how I would specify the icon I want through the IniWritePvt function (or is there another way?).I am using the following code:
ShortcutExtra("Help Desk.URL", "", "", "%dir%help.ico", "0")Let me know if you have any ideas.
Answer 3:
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=20128462C7D2BE0170I 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.txt