Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Slash character modified in a target field of a shortcut

15 views
Skip to first unread message

Gloops

unread,
May 9, 2013, 5:36:52 AM5/9/13
to
Gloops wrote, on 29th Apr. 2013 14:10 UTC + 2 :
> Hello everybody,
>
> I want to create a Windows shortcut to open a directory in the explorer,
> with the tree panel opened on the left.
>
> The syntax of the target to do so is as follows :
>
> "C:\Windows\Explorer.exe" /e, "C:\Documents and Settings"
> (to take the example of that directory)
>
> It appears that this target is systematically modified, to replace "/"
> by "\", and so, the shortcut does not work, until I modify it by hand.
>
> Here is the part of the script I use to obtain that, could anyone tell
> me what my error is ?
>
> I tried `/e after observing that /e did not work.
>
> $destination = $cheminparent + "\" + $dest.Name + "\" +
> $fichiersource.Name;
> $fichiersource.CopyTo($destination)
> $EXPLORER=NEW-OBJECT –Comobject “Shell.Application”
> $EXPLORER.explore($cheminparent + "\" + $dest.Name);
> $WshShell = New-Object -comObject WScript.Shell
> $cheminraccourci = "C:\Documents and Settings\User\Application
> Data\Microsoft\Internet Explorer\Quick Launch\CVCourant.lnk";
> get-item $cheminraccourci -ea SilentlyContinue |
> remove-item -ea SilentlyContinue;
> #this removed the shortcut created the previous time
> #to avoid that the target be added to the existent one
>
> $Shortcut = $WshShell.CreateShortcut($cheminraccourci)
> $tp = "`"C:\Windows\explorer.exe`" `/e, `"" + $cheminparent + "\" +
> $dest.Name + "`""
> $tp
> $Shortcut.TargetPath = $tp
> $Shortcut.Save()
>
>


Somebody gave me a clue on a Windows XP newsgroup : the normal function
of Windows XP is correct, this problem would be caused by a utility, but
the person who said that did not remember which one.


--



































0 new messages