![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Need help creating shortcuts Hi everyone- this is an easy one I think, I just need a little help due to being only a once-in-while vb scripter. I need to create some shortcuts (.lnk files) and want to use vbscript to do it as it seems pretty easy. I'm just having a few issues getting the objLink.TargetPath to behave as I want it to. 1) When I put in forward slashes(/), the shortcut ends up with backlashes (\) 2) I'm having trouble getting paths to 2 items with spaces in the path to work properly. Here are 2 examples of what I would like the Target Path to contain, and cannot get to work properly. 1) "%PROGRAMFILES%\Internet Explorer\iexplore.exe" "C:\Program Files \MyApp\TextFile.txt" 2) %systemroot%\explorer.exe /e, /root, \\server1\users\usershare Any help on setting this up appreciated. Thanks... |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Need help creating shortcuts On Jul 31, 6:36*pm, Mike <thelotu...@xxxxxx> wrote: Quote: > Hi everyone- this is an easy one I think, I just need a little help > due to being only a once-in-while vb scripter. I need to create some > shortcuts (.lnk files) and want to use vbscript to do it as it seems > pretty easy. I'm just having a few issues getting the > objLink.TargetPath to behave as I want it to. > > 1) When I put in forward slashes(/), the shortcut ends up with > backlashes (\) > > 2) I'm having trouble getting paths to 2 items with spaces in the path > to work properly. > > Here are 2 examples of what I would like the Target Path to contain, > and cannot get to work properly. > > 1) "%PROGRAMFILES%\Internet Explorer\iexplore.exe" "C:\Program Files > \MyApp\TextFile.txt" > > 2) %systemroot%\explorer.exe /e, /root, \\server1\users\usershare > > Any help on setting this up appreciated. Thanks... shortcut method in WSH operates differently from the manual creation of a shortcut. The Targetpath property is just that - ONLY the path to the executable. Arguments are provided with the Arguments property. Tom Lavedas =========== |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Need help creating shortcuts "Mike" <thelotus99@xxxxxx> wrote in message news:3bdef61f-cdbf-40ee-8060-74912861b1cb@xxxxxx Quote: > Hi everyone- this is an easy one I think, I just need a little help > due to being only a once-in-while vb scripter. I need to create some > shortcuts (.lnk files) and want to use vbscript to do it as it seems > pretty easy. I'm just having a few issues getting the > objLink.TargetPath to behave as I want it to. > > 1) When I put in forward slashes(/), the shortcut ends up with > backlashes (\) > > 2) I'm having trouble getting paths to 2 items with spaces in the path > to work properly. > > Here are 2 examples of what I would like the Target Path to contain, > and cannot get to work properly. > > 1) "%PROGRAMFILES%\Internet Explorer\iexplore.exe" "C:\Program Files > \MyApp\TextFile.txt" > > 2) %systemroot%\explorer.exe /e, /root, \\server1\users\usershare > > Any help on setting this up appreciated. Thanks... |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Need help creating shortcuts On Jul 31, 8:14*pm, Tom Lavedas <tglba...@xxxxxx> wrote: Quote: > On Jul 31, 6:36*pm, Mike <thelotu...@xxxxxx> wrote: > > > Quote: > > Hi everyone- this is an easy one I think, I just need a little help > > due to being only a once-in-while vb scripter. I need to create some > > shortcuts (.lnk files) and want to use vbscript to do it as it seems > > pretty easy. I'm just having a few issues getting the > > objLink.TargetPath to behave as I want it to. Quote: > > 1) When I put in forward slashes(/), the shortcut ends up with > > backlashes (\) Quote: > > 2) I'm having trouble getting paths to 2 items with spaces in the path > > to work properly. Quote: > > Here are 2 examples of what I would like the Target Path to contain, > > and cannot get to work properly. Quote: > > 1) "%PROGRAMFILES%\Internet Explorer\iexplore.exe" "C:\Program Files > > \MyApp\TextFile.txt" Quote: > > 2) %systemroot%\explorer.exe /e, /root, \\server1\users\usershare Quote: > > Any help on setting this up appreciated. Thanks... > Old issue - mostly with MS documentation. *Notably because the > shortcut method in WSH operates differently from the manual creation > of a shortcut. > > The Targetpath property is just that - ONLY the path to the > executable. *Arguments are provided with the Arguments property. > > Tom Lavedas > =========== Thanks for the tip, that's exactly what I needed. I added 'objLink.Arguments' to my script and it's working fine now. ~Mike |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| creating shortcuts | PowerShell | |||
| Creating desktop shortcuts | Vista General | |||
| Creating shortcuts with PowerShell | PowerShell | |||
| Creating shortcuts from PowerShell | PowerShell | |||
| creating Startmenu-Shortcuts | PowerShell | |||