Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

A Script To Delete A Caertain Folder At Log Off


Recommended Posts

Posted

Hi,

 

There is a program that someone runs and the cache (40mb) is stored in the users profile, so when the user logs off it uploads this rather large file to the server (Roaming Profiles).

 

How do i make a script so the folder is deleted before the transfer to the server is starts please?

 

Thanks

 

Z

Posted

Log off script ?

Or a script which launches the program instead of the normal exe, loops round until the process is closed, when its closed [ the condition is met ] delete the files.

You could use AutoITs ProcessExists function, then the FileDelete.

Posted

Save this as a batch script and add as a logoff script in a GPO...

 

@echo off
echo Deleting cache...
if exist  rd  /S /Q

 

The above may need some revising. It's always hard to remember dos commands when you're on a linux box ;)

Posted
@mattx: Beer might :p

 

And a shot of Smirnoff.....

 

Funny thing logoff scripts - I have never had the need to apply one. I am searching the cobwebs of my brain trying to think of how our network / setup would need one. There must be a need somewhere !!! I want to use one now....

Posted
How could i make it so it deletes the folder from the profile for whoever is logged on?

 

Use the %username% in batch or the @UserName marco in AutoIT.

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...