Jump to content

FileRecycleEmpty not working


Cyri
 Share

Recommended Posts

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

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...