Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NTFS stop folders being moved

Posted on 2010-04-22
10
Medium Priority
?
1,397 Views
Last Modified: 2013-12-02
We have a list of folders on a network share. e.g.

J:\Standard Jobs\S001
J:\Standard Jobs\S002
J:\Standard Jobs\S003
J:\Standard Jobs\S004

I want users to be able to view everything, but should only be able to edit files WITHIN the S00* file.

The S00* folders are created programatically in c#, so I can apply permissions to each folder when they are created.

So far, i've set advanced permissions for them to allow editing/deleting of files within the job folder..  Applied to "Subfolders and Files Only".  This works ok for most things, but when a user accidentally drags one job folder into another, it will move the folder and contents to the other destination, and keep the empty folder that was dragged after displaying the error msg.

So if i accidentally drag S001 into S002, we end up with.

J:\Standard Jobs\S001 <-- empty
J:\Standard Jobs\S002
J:\Standard Jobs\S002\S001.

Anyone faced this challenge before?
0
Comment
Question by:Sc0tte
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 17

Expert Comment

by:Tiras25
ID: 31811513
OK so moving simply means copying from one folder to another and deleting on the source folder.  So you would need to deny the NTFS special permission "delete folder" to the users on the source folder security tab.

Then you will have to deny the NTFS special permission "create folder" to all the target folders.  You need to make sure you assume all targets.

Make sense?
0
 

Author Comment

by:Sc0tte
ID: 31813225
They don't have delete permission for the S00* folders...  thats why when they move them, the contents move,  but an empty folder remains.

I can't really deny "create folder" because user will need to add/remove files/folders int the S00* directory.

0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 31823228
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 7

Expert Comment

by:hutnor
ID: 31832027
Your S001 folder takes permissions from standard jobs folder. I assume they can not delete the S001 because they do not have any delete permission for fodlers & files directly in the standard jobs folder.

If you were to give them access to delete folders under standard jobs then when they move s001 they can delete the folder.
0
 
LVL 7

Expert Comment

by:hutnor
ID: 31832170
Is that what you want to do? get ride of the S001 after it has been moved? or stop them from dragging s001 into s002
0
 

Author Comment

by:Sc0tte
ID: 31832415
Really just want to stop users from dragging S001 into S002
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 31833375
0
 
LVL 47

Accepted Solution

by:
Donald Stewart earned 2000 total points
ID: 31833549
0
 

Author Comment

by:Sc0tte
ID: 32316096
Thanks dstewartjr,  I'll look into that app.

For the time being, i've knocked up a little program that runs during logon (once) for out company...  it increases the number pixels a user must move the item under their mouse before windows triggers that the drag/drop operation is happening.

It works well..  but can be a little weird and annoying sometimes, because it affects *all* drag and drop operations within windows.

C# code attached.

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace DragonDropStop
{
    class Program
    {

        static int SPI_SETDRAGWIDTH = 76;
        static int SPI_SETDRAGHEIGHT = 77;
        static int DISTANCE = 50;

        // ----------------------------------------------------------------------------------------
        // Author:                        ScottE
        // Date:                          27/04/2010 11:25
        // Purpose:                       
        // ----------------------------------------------------------------------------------------
        static void Main(string[] args)
        {
            try
            {
                if (args.Length > 0)
                {
                    try
                    {
                        DISTANCE = int.Parse(args[0]);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Parameter should be an integer number");
                    }
                }
                SystemParametersInfo(SPI_SETDRAGWIDTH, DISTANCE, "", 0);
                SystemParametersInfo(SPI_SETDRAGHEIGHT, DISTANCE, "", 0);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
                Console.Read();
            }
        }

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);

    }
}

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OfficeMate Freezes on login or does not load after login credentials are input.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question