File Deletion

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
daniel
Junior Coder
Posts: 32
Joined: Mon Apr 25, 2005 5:04 pm

File Deletion

Post by daniel » Fri Jun 09, 2006 4:23 pm

I have a questions regarding file deletion. I need to create a macro that begins when a user is login off their computer that will delete all TIF and PDF images from a certain folder in the C: drive. How would I go about that?

Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jun 09, 2006 4:33 pm

Hi,

Like this:

1. Make the script that will delete the files. Something like:

DeleteFile>c:\somefolder\*.pdf
DeleteFile>c:\somefolder\*.tif

2. Now to make the script run on log off you need to add a group policy entry:

i. Click Start then Run and type: gpedit.msc
ii. For log off expand User Configuration / Windows Settings / Scripts (Logon/Logoff)
iii. Double click on Logoff in the right hand pane.
iv. Click Add and type the command line to msched.exe:
c:\program files\mjt net ltd\macro scheduler\msched.exe
And enter the macro name in Parameters. Alternatively compile the script to an executable and just point to that.

Or put the executable in c:\windows\system32\GroupPolicy\User\Scripts\Logoff
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts