WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Shortcut Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Shortcuts - Internet or URL


Question:

Anybody know why the following 7 lines would work on 2000 but not NT? I'm trying to make a shortcut to a secure website on the common desktop. It dies at the shortcutMake with error 1420 (Shortcut functions: Error saving shortcut file). Can't it do a URL shortcut in NT? If not, how do I make that shortcut? If I remove the URL and put a file it works fine.
startdir=RegQueryValue(@REGMACHINE,"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Common Desktop]")
programFiles=RegQueryValue(@REGMACHINE,"Software\Microsoft\Windows\CurrentVersion[ProgramFilesDir]")
iconFile = strCat(programFiles,"\swaicon.ico")
DirChange(startDir)
link = strCat(startDir,"\SWA.LNK")
ShortcutMake(link,"https://a.b.com","","",@ZOOMED,0)
ShortCutExtra(link, "MyABCcom", "", iconFile,0,0)

Answer:

NT doesn't support making shortcuts to URL's like that.

You can use IniWritePvt to create a .URL file:

;.Url Format
;[InternetShortcut]
;URL=http://www.example.com
;IconFile=c:\somedir\iconfile.exe
;IconIndex=0
IniWritePvt("InternetShortcut", "URL", "https://a.b.com", link)
IniWritePvt("InternetShortcut", "IconFile", "c:\somedir\iconfile.exe", link)
IniWritePvt("InternetShortcut", "IconIndex", 0, link)

Article ID:   W16218
File Created: 2004:03:30:15:43:22
Last Updated: 2004:03:30:15:43:22