Creating shortcut 
Author Message
 Creating shortcut

Hello,

I have problem with creating a shortcut on the desktop. The TargetPath is
only partially filled.

This is the script:
    ......
    DesktopPath = WSHShell.SpecialFolders("Desktop")
    Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & \PMail.lnk")
    szPath = "\\NYM-NW-F01\VOLPROG\Programs\PMail\"

    MyShortcut.TargetPath = szPath & "winpm-32 -x NL"
    WScript.Echo MyShortcut.TargetPath
    MyShortcut.WorkingDirectory = szPath
    MyShortcut.WindowStyle = 1
    MyShortcut.IconLocation = szPath & "\winpm-32.exe,0"
    MyShortcut.save

After running the above script the Target is: \\NYM-NW-F01\VOLPROG

The next code works a little bit better:

    ......
    szPath = "H:\Programs\PMail"
    MyShortcut.TargetPath = "H:\Programs\PMail\winpm-32.exe -x NL"
WScript.Echo MyShortcut.TargetPath
    MyShortcut.WorkingDirectory = szPath
    MyShortcut.WindowStyle = 1
    MyShortcut.IconLocation = szPath & "\winpm-32.exe,0"
    MyShortcut.save

Now the Target is: "H:\Programs\PMail\winpm-32.exe -x NL". Windows
doesn't accept the quotes.

The shortcut-sample with notepad from Microsoft works fine.

I'm running:
Windows 95 OSR2
WSCRIPT.EXE version: 5.0.531.7
The fileserver is running Novell Netware 4.11.

Has anyone a solution or an explanation for this?

Thanks in advance,

Ernest van der Loop
Tramedico International BV
The Netherlands



Mon, 26 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Creating shortcut from vbbasic

2. Create Shortcut In Access 97

3. Create Shortcuts in VBA

4. How to create Shortcut Menus?

5. creating shortcuts from code

6. Create Shortcut from VB.Net

7. Help: How to create shortcuts in VB.NET

8. How to create shortcut in VB.net?

9. Creating shortcuts in VB.NET

10. Creating Shortcuts in VB.NET

11. Create shortcut on desktop

12. Creating shortcuts to folders

 

 
Powered by phpBB® Forum Software