Solved

Delete Local All Users Profile Icon Using SCCM 2012

Posted on 2014-02-20
2
1,443 Views
Last Modified: 2014-03-04
Hi,

I have been trying (unsuccessfully) to create a package within SCCM 2012 which deletes an icon from the C:\Users\All Users\Desktop\ area upon logging in.

I have tried via vbscript and cmd.

VBSCRIPT

Const OverwriteExisting = TRUE
Set objNetwork = CreateObject("Wscript.Network")

Set oWS = WScript.CreateObject("WScript.Shell")

Set objFSO = CreateObject("Scripting.FileSystemObject")

if objFSO.FileExists(userProfile & "\Desktop\icon.lnk") then
      objFSO.DeleteFile userProfile & "\Desktop\icon.lnk"
end if

if objFSO.FileExists("C:\Users\All Users\Desktop\icon.lnk") then
      objFSO.DeleteFile "C:\Users\All Users\Desktop\icon.lnk"
end if


I get an error regarding permissions as domain users are not local admins and do not have access to C:\Users\All Users\Desktop

Using CMD

del "C:\Users\All Users\Desktop\icon.lnk" /F /Q

Cannot find file specified as it does not have access to All Users Desktop folder running under current logged in user context.

I have set the SCCM package to run with administrator privileges but this hasn't helped.

Running as a domain admin works fine and the icon is correctly deleted from the All Users\Desktop area.

I am not really sure how SCCM executes commands or scripts under the local system account and how this does not have access to all areas locally.

Is there any other way I can simply create an SCCM package or program which deletes this icon when domain users with no local admin rights log into a machine. Ideally I would then deploy this package/program to a collection of devices.

Thanks
0
Comment
Question by:BrimbankCC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 31

Accepted Solution

by:
merowinger earned 500 total points
ID: 39876368
I think you've the wrong path. This is only a junction Point.

Try this:
del "%Public%\Desktop\icon.lnk" /F /Q

Else make sure the following:

- use Environment variable instead of full paths:

- In Program Properties -> Environment -> "Wether or not a User is logged on"
and "Run with administrative rights"
- Execute the command line as following when using the batch: cmd  /c remove.bat
0
 

Author Closing Comment

by:BrimbankCC
ID: 39905382
Thanks for that. Worked straight away. Much appreciated.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your app took Google’s lash recently, here are the 5 most likely reasons.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question