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.
File Deletion
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?