Cyri Posted December 15, 2009 Share Posted December 15, 2009 I did some testing earlier and it looks like FileRecycleEmpty() doesn't work when run under the SYSTEM account. I'm trying to use it as an image cleanup script run via SCCM OSD which is always run under the local SYSTEM account. When that didn't work I played around with psexec to run as SYSTEM and verified that it doesn't work. Anyone know why? Link to comment Share on other sites More sharing options...
bo8ster Posted December 16, 2009 Share Posted December 16, 2009 Can you post your code? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Skruge Posted December 16, 2009 Share Posted December 16, 2009 I did some testing earlier and it looks like FileRecycleEmpty() doesn't work when run under the SYSTEM account. I'm trying to use it as an image cleanup script run via SCCM OSD which is always run under the local SYSTEM account. When that didn't work I played around with psexec to run as SYSTEM and verified that it doesn't work. Anyone know why?FileRecycleEmpty works fine as the SYSTEM account, but it only empties the SYSTEM recycle bin. (each user has its own)You can see this if you look in the \RECYCLER directory from anything other than Windows Explorer. The folders are named after each user's SID.You can loop through and remove each folder, or get a list of SIDs from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Cyri Posted December 16, 2009 Author Share Posted December 16, 2009 FileRecycleEmpty works fine as the SYSTEM account, but it only empties the SYSTEM recycle bin. (each user has its own)You can see this if you look in the \RECYCLER directory from anything other than Windows Explorer. The folders are named after each user's SID.You can loop through and remove each folder, or get a list of SIDs from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.OK that makes sense then. Wish the documentation actually said that it's a per-user thing though. The function doesn't really make sense in my mind. Why ask for a drive param and not a user/all users param? To me the drive param makes it sound like it's going to delete everything from the recycle bin on that drive...not per-user. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now