Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Running a remove command gets access denied

Hi, 

 

I have made a lockdown GPO for a windows 10 environment but I m having problems with one item, I want to remove the right click from the start button. I have discovered that this can be done quite easily by deleting the following folders..

rmdir "C:\Users\%username%\AppData\Local\Microsoft\Windows\WinX\Group1"
rmdir "C:\Users\%username%\AppData\Local\Microsoft\Windows\WinX\Group2"
rmdir "C:\Users\%username%\AppData\Local\Microsoft\Windows\WinX\Group3"

 

I have created a .bat file with just those 3 lines in, nothing else. I have created a package in PDQ but when I run it the output is access denied. 

 

The logged in user is not a domain admin but i am running it using my credentials in PDQ and i am a domain admin.

 

Any ideas?

0

Comments

2 comments
Date Votes
  • If you're running the package/step/batchfile as a domain admin, then %username% = that specified Domain Admin.

    The only time %username%=logged on user, is when it's being run as "Logged on user"

    0
  • and when i try that I get access denied, when I am logged in as the user though I can just go ahead and delete them using the delete key :baffled!@:

    0