/build/static/layout/Breadcrumb_cap_w.png

AllUsers VB script issue

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.

thanks


--------------------------------------------------------------------------------------------------

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

Wscript.quit

0 Comments   [ + ] Show comments

Answers (3)

Posted by: aogilmor 16 years ago
9th Degree Black Belt
0
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.
Posted by: Trooper23 16 years ago
Orange Belt
0
There is, it doesnt install under user lockdown.
Posted by: aogilmor 16 years ago
9th Degree Black Belt
0
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ