Page 1 of 1 1
Topic Options
#75288 - 2003-06-04 04:06 PM Creating shortcut with WshShortCut()
Raceeend Offline
Starting to like KiXtart

Registered: 2002-05-09
Posts: 129
Loc: The Netherlands
Hello,

I'm trying to create a shortcut with WshShortCut() but from the targetpath some characters get mixed up.

code:
		$Path = "%userprofile%\desktop\Baan V.lnk"
$TargetPath = "\\SR0004\Worktop\bin\Worktop_client.exe \\SR0004\Worktop\documents\$BaanUsername.wtd"
;? "TargetPath = " + $TargetPath
$StartDir = "\\SR0004\Worktop\bin"
$IconPath = "\\SR0004\worktop\bin\worktop.exe"

$x = WshShortCut($Path,$TargetPath,,$StartDir, $IconPath)

the result is:
TargetPath must be --> \\SR0004\Worktop\bin\Worktop_client.exe \\SR0004\Worktop\documents\giex001.wtd
Targetpath gets --> \\Sr0004\Worktop\bin\Worktop_client.exe \SR0004\Worktop\documents\giex001.wtd

Anyone an idea?
_________________________
regards, Martijn

Top
#75289 - 2003-06-04 04:19 PM Re: Creating shortcut with WshShortCut()
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure.
your path is wrong [Big Grin]
quote:
ARGUMENTS Optional. Arguments appended to TARGETPATH
that is the way these work.
the actual path is the thing you are pointing to.
this is normal behaviour.
so your call should be:
code:
$x = WshShortCut("%userprofile%\desktop\Baan V.lnk","\\SR0004\Worktop\bin\Worktop_client.exe","\\SR0004\Worktop\documents\$BaanUsername.wtd", "\\SR0004\Worktop\bin", "\\SR0004\worktop\bin\worktop.exe")

_________________________
!

download KiXnet

Top
#75290 - 2003-06-04 04:20 PM Re: Creating shortcut with WshShortCut()
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
yes

$Path = "%userprofile%\desktop\Baan V.lnk"
$TargetPath = "\\SR0004\Worktop\bin\Worktop_client.exe"
$args = "\\SR0004\Worktop\documents\$BaanUsername.wtd"
$StartDir = "\\SR0004\Worktop\bin"
$IconPath = "\\SR0004\worktop\bin\worktop.exe"

$x = WshShortCut($Path,$TargetPath,$args,$StartDir, $IconPath)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#75291 - 2003-06-04 04:31 PM Re: Creating shortcut with WshShortCut()
Raceeend Offline
Starting to like KiXtart

Registered: 2002-05-09
Posts: 129
Loc: The Netherlands
Thank you!!!!!!!!!!
_________________________
regards, Martijn

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 631 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org