For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > April 2005 > IWshShortcut fails









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author IWshShortcut fails
DooM³d

2005-04-29, 3:55 pm

Hi,

I have a problem using IWshShortcut which just seems to affect Windows
2000??

Im creating shortcuts on the desktop as follows:

Dim oShell As New IWshRuntimeLibrary.IWshShell_Class
Dim oShortcut As New IWshRuntimeLibrary.IWshShortcut_Class
'
ShortcutName = "MY Shortcut"
Set oShortcut = oShell.CreateShortCut(DestinationDirectory & "\" &
ShortcutName & ".lnk"
'
With oShortcut
.WindowStyle = 1
.TargetPath = cTargetFile
.Description = cShortcutName
.Arguments = cArguments
.WorkingDirectory = cStart
.Save
End With

Now this works perfectly under Windows XP but falls over on Windows 2000 at
..Save. Ive checked that all the values are correct and the shortcut is
valid so don;t understand why it doesn't work?

Anyone any ideas as to why this maybe??

Cheers
d


mr_unreliable

2005-04-29, 3:55 pm

hi Doomed,

You might also try posting this on:

news://microsoft.public.scripting.wsh

cheers, jw
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com