Solved

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

Posted on 2014-11-19
14
122 Views
Last Modified: 2014-12-10
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?
0
Comment
Question by:jfholloway
  • 5
  • 4
  • 3
  • +2
14 Comments
 
LVL 24

Expert Comment

by:DMTechGrooup
ID: 40453151
Have you run rsop.msc to see if the policy is being applied?

Which version of MS Server are you using?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40453317
You are running this in a USER GPO. Do the users that run it have permissions to delete files from all of those areas?
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40453318
And to What OU have you attached the policy? The one with ALL of your affected users?
0
 

Author Comment

by:jfholloway
ID: 40453463
It shows nothing in the last executed field on the XP and Windows 7 PCs I looked at. The Domain is Windows 2003.
0
 

Author Comment

by:jfholloway
ID: 40453469
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.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 40453475
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?
0
 
LVL 9

Expert Comment

by:discgman
ID: 40453481
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.
0
Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 
LVL 37

Expert Comment

by:Neil Russell
ID: 40453497
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.
0
 
LVL 9

Expert Comment

by:discgman
ID: 40453513
You asked the same time I did, just took me 2 minutes to write it.
0
 

Author Comment

by:jfholloway
ID: 40453623
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
0
 
LVL 12

Expert Comment

by:jkaios
ID: 40453872
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.
0
 

Author Comment

by:jfholloway
ID: 40454955
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?
0
 
LVL 9

Accepted Solution

by:
discgman earned 500 total points
ID: 40455197
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.
0
 

Author Closing Comment

by:jfholloway
ID: 40491961
Worked perfect. thanks
0

Featured Post

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Join & Write a Comment

Suggested Solutions

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now