• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Script/batch file to run when Windows shuts down

IndyJaws

Golden Member
Can anyone help me create a script or batch file that will move a specific directory to the Recycle Bin each time Windows is shut down? The issue I've had is that there is no specific directory location for the Recycle Bin from what I can see. Any help is greatly appreciated.

Thanks in advance,
IndyJaws
 
(BASED ON WINDOWS XP)

Ok I grabbed some info for you, but you are going to have to do some testing.

The recycling bin should be "C:\Recycler\<currently logged on users SID>".

To find the currently logged on users sid do: getsid \\<DC SERVER> %username% \\<DC SERVER> %username%

getsid is a resource kit utility.
 
Example of grabbing the current sid (this assumes it has no problems finding the sid):

for /f "tokens=7" %%i in ('getsid \\bleh %username% \\bleh %username%') do set csid=%%i

There may be a better way to get the current sid via the registry, but I couldn't find one... I don't mess with sids very often.
 
Back
Top