removing a file from the start menu in wondows XP and Windows 7

I am trying to remove a .bat file that is in the start menu on the PCs in my network by using a .bat file that I created and put in a GPO in the logon script option but, it appears the PCs aren't running the script because the .bat file is still in the start menu. These are the lines I have in the .bat file that I am trying to execute via the GPO. I also have attached the GPO to the OU in GPO mgmt console. I know my .bat file works because if I run it manually it works.

del "c:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\standard drives.bat"
del "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\drives.bat"
del "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\standard drives.bat"

Can someone tell me what is wrong?
jfhollowaySr. Systems AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have you run rsop.msc to see if the policy is being applied?

Which version of MS Server are you using?
Neil RussellTechnical Development LeadCommented:
You are running this in a USER GPO. Do the users that run it have permissions to delete files from all of those areas?
Neil RussellTechnical Development LeadCommented:
And to What OU have you attached the policy? The one with ALL of your affected users?
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

jfhollowaySr. Systems AdministratorAuthor Commented:
It shows nothing in the last executed field on the XP and Windows 7 PCs I looked at. The Domain is Windows 2003.
jfhollowaySr. Systems AdministratorAuthor Commented:
I attached it to the OU where the user accounts are. I believe they have the proper rights because when I run my script manually it does delete the file from the start menu.
Neil RussellTechnical Development LeadCommented:
When YOU run it manually yes. Are YOU just a normal user? Not a domain admin?

Have you had User run it manually after they are logged in?
The bat files in the gpo usually run before the user logs in, so I am not sure if its a permissions issue. Try to run the bat file manually on a user who doesnt have the same permissions as you do and see if you get the same results.
Neil RussellTechnical Development LeadCommented:

If you're running the script at user logon, it runs under the user's own security context. Would be pointless to run as anything else.

And I already asked to try as a different user after login to see results.
You asked the same time I did, just took me 2 minutes to write it.
jfhollowaySr. Systems AdministratorAuthor Commented:
I run the .bat file manually when I am logged in as the user. The users are just standard domain users with no elevated privileges
jkaiosIT DirectorCommented:
AFAIK, on Windows XP security, standard domain users can't touch (write/delete) anyting in the %ALLUSERSPROFILE% (C:\Documents and Settings\All Users\...) and so may be true with Windows 7 (C:\ProgramData\) as well.
jfhollowaySr. Systems AdministratorAuthor Commented:
Would the following work in place of the trying to delete the file from the "all users" directory replace it with %username%

del "C:\Documents and Settings\%username%\Start Menu\Programs\Startup\standard drives.bat"

Where is the correct place to put the .bat to run it at logon. I currectly have it at the root of the netlogon folder. Should it be there or is the sysvol folder inside of the GPO that I have the logon parameter set?
Where is the correct place to put the .bat to run it at logon. I currectly have it at the root of the netlogon folder. Should it be there or is the sysvol folder inside of the GPO that I have the logon parameter set?

If you put it in the sysvol folder, then it has to be run in the logon script box under each user name in AD. It would then run when each user logs in. You could test a few and see if that works. If it does, then you could add this option to all the users you need to with a ldap script or mass copy and paste.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jfhollowaySr. Systems AdministratorAuthor Commented:
Worked perfect. thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.