ginglese
2nd November 2007 14:03 UTC
removing files in $SMSTARTUP
hi,
i have written a script that install my program and add shortcut in the $SMSTARTUP.
Now i have to update my program an so i have written an update script that must remove the shortcut in $SMSTARTUP then add new ones.
to remove the old shortcut i write:
Delete "$SMSTARTUP\*" (i have also tried to write Delete "$SMSTARTUP\*.lnk")
My problem is that the shortcut are not removed and i have the old and the new one after the update.
In fact old shortcut have been created by an installshield script, are they locked ?
any tips ?
guillaume
Afrow UK
2nd November 2007 18:33 UTC
Try using the actual file name. Also what happens if there are other shortcuts in startup? They would be deleted as well with that code (assuming it worked).
Also make sure you are in the correct shell variable context.
SetShellVarContext all|current
(That's all users or current user).
Stu
ginglese
6th November 2007 13:04 UTC
i have also tried with files name but it's not working.
i bet on the "all users | current user" option
i will not be able to test that before mid of november.
i will give you the result when done.
thanks.
ginglese
10th November 2007 00:36 UTC
ok.
i have made the test.
i just add this lines :
SetShellVarContext all
Delete "$SMSTARTUP\*.*
SetShellVarContext current
Delete "$SMSTARTUP\*.*
and it works, no more old shortcut.
thanks for the tip.
guillaume
Anders
10th November 2007 01:30 UTC
doing a *.* delete is not smart, you really should specify the name used when you created it,
ex: Delete "$SMSTARTUP\FooBarBaz.* (otherwise you could delete your users other startup items)