Hello Everyone,
I'm rolling out Media Player 10 to my users on a XP image.

After install a icon appears under \All Users\Start Menu\Programs\Windows Media Player.lnk then a new folder and icon are created here: \All Users\Start Menu\Programs\Accessories\Entertainment\Windows Media Player.lnk.

I need to delete the icon under ALLUsers\Programs, then move the icon that is in the Entertainment folder to the Accessories\Multimedia , then delete the Entertainment folder. Of course my script isn't working.



Dim wshShell, objFSO, objShell2, objFolder, objFolderItem

Const DeleteReadOnly=True
Const OverwriteExisting = True
Const ALLUsers=&H16&
strComputer = "."

Set wshShell=CreateObject("Wscript.Shell")
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objShell2=CreateObject("Shell.Application")
Set objFolder=objShell2.Namespace(ALLUsers)
Set objFolderItem=objFolder.Self

ON Error Resume Next

'wscript.echo "path = " & objFolderItem.Path

strFilePath = objFolderItem.Path & "\Start Menu\Programs\Accessories\Entertainment\Windows Media Player.lnk"
strDestination =objFolderItem.Path & "\Start Menu\Programs\Accessories\Multimedia\Windows Media Player.lnk"

If objFSO.FileExists(strFilePath) Then
' Wscript.Echo "copying lnk"
objFSO.CopyFile strFilePath , strDestination, OverwriteExisting
End if

If objFSO.FileExists(objFolderItem.Path & "\Start Menu\Programs\Windows Media Player.lnk") Then
Wscript.Echo "deleting old lnk"
objFSO.DeleteFile(objFolderItem.Path & "\Start Menu\Programs\Windows Media Player.lnk"), DeleteReadOnly
End if

If objFSO.FileExists(objFolderItem.Path & "\Start Menu\Programs\Accessories\Entertainment\Windows Media Player.lnk") Then
Wscript.Echo "deleting second old lnk"
objFSO.DeleteFile(objFolderItem.Path & "\Start Menu\Programs\Accessories\Entertainment\Windows Media Player.lnk"), DeleteReadOnly
End if

If objFSO.FolderExists(objFolderItem.Path & "\Start Menu\Programs\Accessories\Entertainment") Then
Wscript.Echo "deleting folder"
objFSO.DeleteFolder(objFolderItem.Path & "\Start Menu\Programs\Accessories\Entertainment")
End if

0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


isnt' there a reskit or an admin utility where you can take those shortcuts out of the installation?
That seems like a lot of code to delete shortcuts.
Answered 04/03/2008 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
There is, it doesnt install under user lockdown.
Answered 04/03/2008 by: Trooper23
Orange Belt

Please log in to comment
ORIGINAL: Trooper23
There is, it doesnt install under user lockdown.

I meant to configure the installation before it hits the machines, not install the reskit on user machines.
Answered 04/03/2008 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity