+ Post New Thread
Results 1 to 9 of 9
Scripts Thread, A Script To Delete A Caertain Folder At Log Off in Coding and Web Development; Hi, There is a program that someone runs and the cache (40mb) is stored in the users profile, so when ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    A Script To Delete A Caertain Folder At Log Off

    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

  2. #2

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: A Script To Delete A Caertain Folder At Log Off

    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.

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Re: A Script To Delete A Caertain Folder At Log Off

    Just a script that will delete a folder at log off.

    Z

  4. #4

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 770 Times in 598 Posts
    Rep Power
    183

    Re: A Script To Delete A Caertain Folder At Log Off

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

    Code:
    @echo off
    echo Deleting cache...
    if exist <path to file> rd <path to folder> /S /Q
    The above may need some revising. It's always hard to remember dos commands when you're on a linux box

  5. #5

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: A Script To Delete A Caertain Folder At Log Off

    The above may need some revising. It's always hard to remember dos commands when you're on a linux box
    Would Wine help ?

  6. #6

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,592
    Thank Post
    109
    Thanked 770 Times in 598 Posts
    Rep Power
    183

    Re: A Script To Delete A Caertain Folder At Log Off

    @mattx: Beer might :P

  7. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: A Script To Delete A Caertain Folder At Log Off

    Quote Originally Posted by Ric_
    @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....

  8. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,234
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Re: A Script To Delete A Caertain Folder At Log Off

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

    Thanks

    Z

  9. #9

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: A Script To Delete A Caertain Folder At Log Off

    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Delete a folder using scripting
    By FN-GM in forum Scripts
    Replies: 15
    Last Post: 22nd December 2007, 04:44 PM
  2. delete same folder from all users home area
    By markcuk in forum How do you do....it?
    Replies: 27
    Last Post: 25th April 2007, 10:38 AM
  3. Got a folder I cannot delete or take ownership of
    By sidewinder in forum Windows
    Replies: 2
    Last Post: 20th March 2007, 02:49 PM
  4. Replies: 1
    Last Post: 21st January 2007, 02:51 PM
  5. Replies: 3
    Last Post: 25th September 2006, 12:27 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •