From: Bee on 7 Mar 2010 20:05 Problem is - what if there is no room on the C: drive and there is a 2T drive on E: ? What then? How does anyone handle this? I am not going to tell users to move files off the C: drive. And the C: drive may be to small for what they want to do, so they bought a 2T Drive for data. Shared Data! I cannot limit what the user wants to do except for the physical size of a disk on their system, no necessarily C: More Suggestions? Please! "Nobody" wrote: > "Bee" <Bee(a)discussions.microsoft.com> wrote in message > news:F43267B0-46BA-40CB-ACC2-D7FE7AC86748(a)microsoft.com... > > My app can generate many gigabytes of data files (several megabytes each) > > per > > the user choice. For those who wonder, this happens over many hours and > > or > > days. > > > > I am making XP and up a requirement for using the app. > > So, for XP and up how do I do the following: > > > > (1)Set permissions on a different hard drive (other than C:) to read, > > write > > and delete data files. > > (a)for this user > > (b)for all users (common data). > > > > (2)Create a folder (assumes this is different than "normal"). > > > > I may be totally wrong, but I assume that reading, writing and deleting > > the > > file in this folder once created is as usual. > > > > (3) when I reopen the app, do I need to do anything if I find the folder > > previously created? e.g. set permissions again? etc. > > > Setting the permissions will not work unless the user has enough privileges, > so if user can't do it with Windows Explorer, your application can't, it > would get access denied errors. One solution is at install time, install an > ActiceX EXE and configure it to run as SYSTEM, then talk to it using your > app. This AX EXE would change the permissions for you. > > Another approach is to use the already available writable folders. Here are > some choices: > > 1 - Per user: Use CSIDL_LOCAL_APPDATA. You cannot use CSIDL_APPDATA or > CSIDL_PERSONAL(My Documents) because if roaming was enabled, it would take > forever for the user to log on or log off. When a roaming user logs on or > off, his profile(including My Documents, and CSIDL_APPDATA, and the user's > version of HKEY_CURRENT_USER) are transported back and forth from a server, > so this would take a long time if there are big files in these locations. > > 2 - All users: Use CSIDL_COMMON_DOCUMENTS. This is usually in XP/2003: > > C:\Documents and Settings\All Users\Documents > > In Windows Explorer, go to the bottom of the folders list and try to find > "Shared Documents". This is the friendly name of the above folder. > > In Vista+, this is "C:\Users\Public\Documents", with a friendly name "Public > Documents" under a friendly name "Public" folder. > > This folder, unlike CSIDL_COMMON_APPDATA, can be read and written to by all > users without needing to change the permissions. It's for user saved files > that are meant to be shared by all users on the same computer. It's not > "suitable" for INI files and the like as much as they are not suitable in > "My Documents" folder. They would be seen as being stored in an odd place. > > > > > > . >
From: Bee on 7 Mar 2010 20:26 2 & 3 are asking about permanence of the setting. by what i see so far, it is permanent until it is programmatically changed. not knowing the terminology yet, does the method talked about here in 825751 and 266461 need the logged in user to be a super admin to set permissions for all for a data folder. I am only storing text and images i create as directed by the user direct commands. if a business system admin want to stop this, then the app will be of no value to the user when used in this manner. i have seen that in business situatons a remote folder is assigned to a user and no other login other than the usual start up login is needed. so for he business case, this is actually simpler than for a home user. "Paul Clement" wrote: > On Fri, 5 Mar 2010 17:36:36 -0800, Bee <Bee(a)discussions.microsoft.com> wrote: > > ¤ My app can generate many gigabytes of data files (several megabytes each) per > ¤ the user choice. For those who wonder, this happens over many hours and or > ¤ days. > ¤ > ¤ I am making XP and up a requirement for using the app. > ¤ So, for XP and up how do I do the following: > ¤ > ¤ (1)Set permissions on a different hard drive (other than C:) to read, write > ¤ and delete data files. > ¤ (a)for this user > ¤ (b)for all users (common data). > ¤ > ¤ (2)Create a folder (assumes this is different than "normal"). > ¤ > ¤ I may be totally wrong, but I assume that reading, writing and deleting the > ¤ file in this folder once created is as usual. > ¤ > ¤ (3) when I reopen the app, do I need to do anything if I find the folder > ¤ previously created? e.g. set permissions again? etc. > > The following should help you set permissions: > > http://support.microsoft.com/kb/825751 > > ADSI (which is a little more complicated): > > http://support.microsoft.com/kb/266461 > > I don't really understand what you're asking in questions 2 & 3. > > Paul > ~~~~ > Microsoft MVP (Visual Basic) > . >
From: Bee on 7 Mar 2010 20:28 thanks but is it correct that the user can only set the permission level to him/herself and not allow the data to be shared by others? I need to allow the text and image files that the user creates to be shared by all users. the user controls the generation and amount of data. and as i have stated, it may be mandatory for the user to select a different drive than C: due to space limitations. "mayayana" wrote: > There's a compact class here that I use for my installers: > > http://www.jsware.net/jsware/vbcode.php5#perms > > There are 3 function: > > 1) Check the partition formatting. (XP is not necessarily on > NTFS. It may be on FAT32. And a data partition can be > FAT32. Permissions only apply to NTFS.) > > 2) Get current permissions on a file/folder/Registry key. > > 3) Set permissions on a file/folder/Registry key. The setting > permissions function is basic: add or remove full permission > for all. > > > My app can generate many gigabytes of data files (several megabytes each) > per > > the user choice. For those who wonder, this happens over many hours and > or > > days. > > > > I am making XP and up a requirement for using the app. > > So, for XP and up how do I do the following: > > > > (1)Set permissions on a different hard drive (other than C:) to read, > write > > and delete data files. > > (a)for this user > > (b)for all users (common data). > > > > (2)Create a folder (assumes this is different than "normal"). > > > > I may be totally wrong, but I assume that reading, writing and deleting > the > > file in this folder once created is as usual. > > > > (3) when I reopen the app, do I need to do anything if I find the folder > > previously created? e.g. set permissions again? etc. > > > > > . >
From: mayayana on 7 Mar 2010 22:43 > thanks > but is it correct that the user can only set the permission level to > him/herself and not allow the data to be shared by others? > I need to allow the text and image files that the user creates to be shared > by all users. the user controls the generation and amount of data. > and as i have stated, it may be mandatory for the user to select a different > drive than C: due to space limitations. > I think that Nobody addressed that. You need to create the folder(s) during install when you're running as Admin. Failing that, you'd need another process that runs as Admin, or just leave it up to the person using the software to log on as Admin when they create the folder. Nobody's explanation is pretty much what I thought was the case: Someone who's running as a normal user can create a folder, but other "normal users" can't access it.
From: mayayana on 7 Mar 2010 23:22
> I will take a look. > Thanks > Those are both VBScript hacks with dependencies. You don't need that. The link I gave you is simple, concise API code. |