Jolly polly wrote, on 04th May 2013 20:59 UTC + 2 :
>> The first part is OK, but the target of the shortcut is modified for
>> an unknown reason.
By "The first part", I meant opening the explorer with
new-object -comObject "Shell.Application"
Remember :
$EXPLORER=NEW-OBJECT –Comobject “Shell.Application”
$EXPLORER.explore($cheminparent + "\" + $dest.Name);
This runs jolly good, this is why I said that the first part is OK.
It is with the shortcut then that I have a problem. Its target is
modified for an unknown reason.
So, I realize it was not clear with a bulleted list, so I am going to
try with an ordered one.
After creating a new directory, the script must :
1. Open it in the explorer
2. Create a shortcut that allows to do it again the day after.
Part 1 is OK, part 2 is buggy.
>
> I'm not sure I understand, how about...
perhaps not ;)
>
> $Drive = "C:\Users\"
> $ShellExp = new-object -comObject Shell.Application
> $ShellExp.explore($Drive)
>
> does this help?
>
only for part 1, it is what I did.
And I persist to think that replacing a shortcut by a new Powershell
script is not a good idea in itself, as Powershell takes about 30
seconds to load. A batch does not seem to create this problem, it is a
question of "nice code" : why adding another layer, whereas the shortcut
is supposed to open the directory directly ?