It's easy to forget you've shared a folder from Google Drive with someone. There are visual indicators that show a folder is shared, but if you're busy working, or don't spend a lot of time logged into Google Drive, you may not notice them.
When you come across a situation where you want to limit the amount of time that your folder remains shared, there's a script that can help you add an expiration date to the sharing status. The way it works is by creating a duplicate of what you originally shared (minus the shared status) and deleting the original that others have access to. Ready to get started? Here's how:
Step 1: Add a copy of this script to your Google Drive. This is done by going to File > Make a copy.
Step 2: Replace the FOLDER_URL value with the URL to your own shared folder. Then, set the EXPIRY_TIME value to your preferred expiration date.
Step 3: On the menu bar, go to Run > Initialize to grant permissions for the script to work on your folder. Then, go to Run > Start and your script will cease sharing status for the folder on the date and time you specified.
Please note: This script works only on folders. If you need to share a file, just place it inside its own folder.
This script requires you to perform a couple of extra steps when you share a folder, but it's useful because you don't have to worry about revoking sharing privileges later.
(Via Digital Inspiration)