Question : Internet shortcut via batch file

I'm trying to automatically create an internet shortcut & apply an icon to it via a logon script. Here's the script:

xcopy \\ipremisesvr\netlogon\HelpMe.url "%userprofile%\Desktop" /y
echo IconFile=\\ipremisesvr\netlogon\icon.bmp >"%userprofile%\desktop\HelpMe.url"
echo IconIndex=0 >"%userprofile%\desktop\HelpMe.url"

So far the script is called successfully and a link is created on the user's desktop, but it is a broken link. Clicking on it results in the error "The target "" of this Internet Shortcut is not valid. Go to the Internet Shortcut property sheet and make sure the target is correct." The url file that is being copied definitely works though.

Also, the icon is not being changed. I can change it manually to the small bitmap image, but not via the batch file.

Answer : Internet shortcut via batch file

Okay, this MS article http://support.microsoft.com/kb/110006 says this:

Note: The Update Remote References  check box is not a universal setting. When two workbooks are open, one workbook might have its Update Remote References setting selected whereas the check box is cleared in the other workbook. However, when you open a workbook, its Update Remote References check box will be selected, no matter how it was saved, unless it contains links to an external data source.

There's a VB procedure on the page for turning the setting off:

  Sub Example()
       ' The zero after updateLinks indicates that neither external nor
       ' remote references should be updated when the file is opened.
       Workbooks.Open fileName:="C:\EXCEL\TEST.XLS", updateLinks:=0
       ' Turn off the Update Remote References setting for the workbook.
       ActiveWorkbook.UpdateRemoteReferences = False
   End Sub
      
Random Solutions  
 
programming4us programming4us