jfholloway
asked on
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%\AppDa ta\Roaming \Microsoft \Windows\S tart Menu\Programs\standard drives.bat"
del "c:\ProgramData\Microsoft\ Windows\St art Menu\Programs\Startup\driv es.bat"
del "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\stan dard drives.bat"
Can someone tell me what is wrong?
del "c:\Users\%username%\AppDa
del "c:\ProgramData\Microsoft\
del "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\stan
Can someone tell me what is wrong?
You are running this in a USER GPO. Do the users that run it have permissions to delete files from all of those areas?
And to What OU have you attached the policy? The one with ALL of your affected users?
ASKER
It shows nothing in the last executed field on the XP and Windows 7 PCs I looked at. The Domain is Windows 2003.
ASKER
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.
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?
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.
No.
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.
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.
ASKER
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
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.
ASKER
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\stan dard 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?
del "C:\Documents and Settings\%username%\Start Menu\Programs\Startup\stan
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked perfect. thanks
Which version of MS Server are you using?