Jump to content

Recommended Posts

Posted
I've got a .bat file I want to run on startup, but it needs to run as administrator - anyone know a way of doing that, or could anyone re-write the command in vbs for me?
Posted
computer startup scripts do run as admin as far as im aware

 

Yup the do - if its not working there is something wrong with the script! Can you call it from a command prompt and it do want you want as admin?

Posted
Yup the do - if its not working there is something wrong with the script! Can you call it from a command prompt and it do want you want as admin?

 

Yes, the batch file runs fine from a command prompt as administrator, but not as my regular domain admin logon.

 

Basically, I'm trying to delete the cached user profiles - these should be getting deleted at logoff by Group Policy, but on this one computer they're not, and this is causing profile corruption problems. I thought scripting them to delete at startup would be a good stop-gap whilst I fix the GPO issue.

Posted
User startup scripts run with the the same rights as the user logging on. You will be able to use the script in the machine startup policy as that will run with system rights. However if this is XP we are talking about you could insall the "User Hive Cleanup" utility from MS and also use delprof.exe in a machine startup script.
Posted
Win 7 Pro.

 

Try looking in registry hklm/software/microsoft/windows nt/current version/profilelist you may find windows 7 has the profile backed up you would see a uuid.bak if it is - if there is one just delete it.

 

There is an ms kb about this somewhere. it always causes users to login with temp profile.

Posted
Thanks Glennda. I remember that, now you say about it. This isn't the temp profile issue, but I'll give that a try anyway...
Posted
Thanks Glennda. I remember that, now you say about it. This isn't the temp profile issue, but I'll give that a try anyway...

 

Windows 7 should clear profiles anyway, so if it isn't there is something else wrong, if its only happening on one machine i would just image/rebuild it!

Posted

Windows 7 isn't like XP where you can just clear profiles by deleting the folder from \Users (or Documents and Settings). I tried that when first testing profiles, and it caused major issues. You need to remove them from System Settings/Advanced/User Profiles (which also deletes the registry entries). Not sure how this can be done by script though.

 

TBH, I've found Windows 7 looks after this quite well anyway, though we still get profiles sticking when the reg key isn't unloaded at logoff. Doesn't stop logons though.

Posted
I agree that Windows 7 should be sorting this itself, however in this instance it isn't. I have found that deleting the user's profile at C:\Users\[username] clears the problem, so want to set that up as a stop-gap whilst I address what is actually wrong with it. I've already re-imaged it without success, I may try it in a different OU to see if that does anything.
Posted
Try looking in registry hklm/software/microsoft/windows nt/current version/profilelist

No, her profile isn't listed in the registry.

Posted
I agree that Windows 7 should be sorting this itself, however in this instance it isn't. I have found that deleting the user's profile at C:\Users\[username] clears the problem, so want to set that up as a stop-gap whilst I address what is actually wrong with it. I've already re-imaged it without success, I may try it in a different OU to see if that does anything.

 

In that case look into running delprof2 as a shutdown script just put the path to the executable and the switches you want to use in the box it doesn't actually have to be a script it can be used to run an exe.

 

Ben

Posted
No need for the script any more. I've just found that the printers GPO was set to "replace" in User Group Loopback processing mode; changing that to "merge" has solved the problem.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...