creating a desktop-shortcut 
Author Message
 creating a desktop-shortcut

I tried to create a desktop shortcut (for an installation script), so I
used a vb-script which contains:
MyShortcut.TargetPath="c:\program files\myprogdir\myprog.exe"
This works fine.

The program requires some arguments (fixed), so I actually need the
target to be:
"c:\program files\myprog\myprog.exe" -arg1 argstr
This is what the original vendor shortcut contains.

I tried:
MyShortcut.TargetPath=chr(34) & "c:\program files\myprogdir\myprog.exe"
& chr(34) & "-arg1 argstr"
This does not work.

Does anyone know how to achieve this in vbs?

Thanks in advance,

Ernest



Mon, 29 Aug 2005 20:00:49 GMT  
 creating a desktop-shortcut

Quote:

> I tried to create a desktop shortcut (for an installation script), so I
> used a vb-script which contains:
> MyShortcut.TargetPath="c:\program files\myprogdir\myprog.exe"
> This works fine.

> The program requires some arguments (fixed), so I actually need the
> target to be:
> "c:\program files\myprog\myprog.exe" -arg1 argstr
> This is what the original vendor shortcut contains.

> I tried:
> MyShortcut.TargetPath=chr(34) & "c:\program files\myprogdir\myprog.exe"
> & chr(34) & "-arg1 argstr"
> This does not work.

Hi

You need to use the Arguments property:

MyShortcut.TargetPath="c:\program files\myprogdir\myprog.exe"
MyShortcut.Arguments = "-arg1 argstr"

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Mon, 29 Aug 2005 21:33:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. creating a desktop-shortcut

2. Need code to create Windows desktop shortcut

3. Create A Desktop Shortcut During Setup

4. Creating a Desktop Shortcut

5. Package & Deployment Wizard - creating a desktop shortcut

6. How do you create a desktop shortcut....

7. Create shortcut in desktop

8. Create Shortcuts on Desktop

9. Creating desktop folder shortcuts

10. How to create desktop shortcut

11. How to create desktop shortcut?

12. Creating a shortcut on the desktop

 

 
Powered by phpBB® Forum Software