For Programmers: Free Programming Magazines  


Home > Archive > VBScript > November 2004 > Shortcut problem with Explorer TargetPath using VBS









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 Shortcut problem with Explorer TargetPath using VBS
jp

2004-11-21, 3:56 pm


wonder if someone can put me on the right path with a problem i am
experiencing.

I am creating a shortcut script for several programs and one of them
is Explorer. The script i have works perfectly for all applications if
the script is without arguments.

Here's my code (short version of error code) for Explorer


oMyShortcut.TargetPath = "%SystemRoot%\explorer.exe /n, /e, "


This produces an error whereby the " " marks at the beginning and the
end are still placed in the TargetPath field in the shortcut.

ie: "%SystemRoot%\explorer.exe /n, /e, "

I need to find a way to strip the " " from the TargetPath output so
that it can work.

ie: %SystemRoot%\explorer.exe /n, /e,


The error occurs because of the " /n, /e," arguments, if you remove
these then the shortcut is perfect.

I have tried many ways of testing this and it eludes me, not that i am
a vbs code guru or anything, just a guy trying to set my system up.


:)

John
Dave Patrick

2004-11-21, 3:56 pm

Try manually creating a shortcut with the use of your double switch and you
should find this is not allowed.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"jp" wrote:
|
| wonder if someone can put me on the right path with a problem i am
| experiencing.
|
| I am creating a shortcut script for several programs and one of them
| is Explorer. The script i have works perfectly for all applications if
| the script is without arguments.
|
| Here's my code (short version of error code) for Explorer
|
|
| oMyShortcut.TargetPath = "%SystemRoot%\explorer.exe /n, /e, "
|
|
| This produces an error whereby the " " marks at the beginning and the
| end are still placed in the TargetPath field in the shortcut.
|
| ie: "%SystemRoot%\explorer.exe /n, /e, "
|
| I need to find a way to strip the " " from the TargetPath output so
| that it can work.
|
| ie: %SystemRoot%\explorer.exe /n, /e,
|
|
| The error occurs because of the " /n, /e," arguments, if you remove
| these then the shortcut is perfect.
|
| I have tried many ways of testing this and it eludes me, not that i am
| a vbs code guru or anything, just a guy trying to set my system up.
|
|
| :)
|
| John


Joe Fawcett

2004-11-21, 8:55 pm

See the arguments property of shortcut.

--

Joe (MVP-XML)

"jp" <paulm@kcbbs.gen.nz> wrote in message
news:fde1q01ncf4hri5ecs2lhakr8fg915eda1@
4ax.com...
>
> wonder if someone can put me on the right path with a problem i am
> experiencing.
>
> I am creating a shortcut script for several programs and one of them
> is Explorer. The script i have works perfectly for all applications if
> the script is without arguments.
>
> Here's my code (short version of error code) for Explorer
>
>
> oMyShortcut.TargetPath = "%SystemRoot%\explorer.exe /n, /e, "
>
>
> This produces an error whereby the " " marks at the beginning and the
> end are still placed in the TargetPath field in the shortcut.
>
> ie: "%SystemRoot%\explorer.exe /n, /e, "
>
> I need to find a way to strip the " " from the TargetPath output so
> that it can work.
>
> ie: %SystemRoot%\explorer.exe /n, /e,
>
>
> The error occurs because of the " /n, /e," arguments, if you remove
> these then the shortcut is perfect.
>
> I have tried many ways of testing this and it eludes me, not that i am
> a vbs code guru or anything, just a guy trying to set my system up.
>
>
> :)
>
> John



jp

2004-11-21, 8:55 pm

Thanks for the feedback - however I'm trying to use VBS to automate my
configuration and while i can do it manually i have given myself a
task to try and automate as much as i can via VBS.

This way on a reboot of a virgin system after the scripts are deployed
it will boot up with most of the tweaking done and save me loads of
effort in doing it manually. I have notice that changing the screen
resolution for 640 x 480 to 1280 x 1024 is somewhat out of my scope
and so a manual approach to these sorts of tweaks is the road i will
travel, even though there are tools out there.

Having said that its taking me loads of effort to do the scripts and
stick and paste together VBS files to do the trick. 100% is done via
the registry so hence my request for help.

In essence i am trying to remove the load of installing applications
to do the tweaking, when XP in facts has the power to change what i
want without too much drama via VBS/WSH and thus if i use scripts my
system is less cluttered.


John


On Sun, 21 Nov 2004 09:13:26 -0700, "Dave Patrick"
<mail@Nospam.DSPatrick.com> wrote:

>Try manually creating a shortcut with the use of your double switch and you
>should find this is not allowed.


jp

2004-11-21, 8:55 pm

Thanks for that. I will search the net for arguments.

John


On Sun, 21 Nov 2004 20:37:47 -0000, "Joe Fawcett"
<joefawcett@hotmail.com> wrote:

>See the arguments property of shortcut.


jp

2004-11-21, 8:55 pm

Your a scholar and a gentleman - worked like a dream.

fix now is: (very quick)

ExpPath = "%SystemRoot%\explorer.exe"

oMyShortcut.TargetPath = ExpPath

oMyShortcut.Arguments = " /n, /e, "


:)

John

On Sun, 21 Nov 2004 20:37:47 -0000, "Joe Fawcett"
<joefawcett@hotmail.com> wrote:

>See the arguments property of shortcut.


Sponsored Links







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

Copyright 2010 codecomments.com