Results 1 to 12 of 12

Thread: Can I always write to the windows system directory ?

  1. #1

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Can I always write to the windows system directory ?

    My application uses a number of DLLs that I have packaged with it.
    But for ease of deployment I have included the .dlls into the .exe, and at runtime if the system doesn't have the .dlls it extracts them to the windows system directory.

    But is there any situation in which I would not be able to write to the system directory ?
    I personally can't think of one, but I thought I'd ask just in case...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Well, the odds of the system admin restricting file i/o access are pretty slim (if its even possible), but that is all I can think of.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Yeah that's what I was thinking of...
    I suppose in situations like that, they'd already be expecting most apps to fall flat on their faces.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4
    Banned Wafflehose's Avatar
    Join Date
    Apr 2001
    Location
    Quantico, VA
    Posts
    34
    Actually, I have a reason that you cannot. We are working on deploying a program right now for the military. Many people on government machines do not have full admin rights. For whatever reason, certain downloads cannot occur, and changing the system files. This is a problem that we are having to work out. On many machines we are installing this program for testing, we are getting the following error.

    "Cannot update system file 'C\WINNT\system32\xceedzip.dll'. You do not have permission to update system files on this machine."

    Yes you can always have an administrator do it for you, but we are trying to have it so each user can just do it themself. Hope this helps you out some.

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    I believe the default permissions on the system directory (system32) on NT based OS's is read and execute for normal users, full control for administrators and Modify (or change) for power users.

    Normal users cannot write anything to the system directory (so they need an admin to install a program, just like most admins would like).

    If you also need to register a dll, a normal user couldn't do that, because a normal user does not have write permission on HKEY_CLASSES_ROOT.

    Your approach would restrict the program to be used by power users and administrators only.
    Frans

  6. #6

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well I don't need to update any files or register any files.
    If the file isn't present in that folder, then the file should be created.

    That, in italics, is the logic behind what I need to do.
    That should be okay shouldn't it ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7
    Banned Wafflehose's Avatar
    Join Date
    Apr 2001
    Location
    Quantico, VA
    Posts
    34
    Originally posted by plenderj
    Well I don't need to update any files or register any files.
    If the file isn't present in that folder, then the file should be created.

    That, in italics, is the logic behind what I need to do.
    That should be okay shouldn't it ?
    I would say yes. Problems with this are more common on government machines. Some people have permissions to do everything, and others aren't even able to turn off their machines without an admin password. I don't think though that there would be a problem creating the files.

  8. #8
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Originally posted by plenderj
    That should be okay shouldn't it ?
    No!!!
    With only read and execute permissions the user can change nothing in this folder. They can NOT create files, they can not modify files. They can do nothing that changes anything in the folder.
    They can only read files, and execute files (if the file is executable: exe's, dll's ocx's etc).
    Frans

  9. #9

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Okay assuming its not a military or government machine with restricted rights, there shouldn't be too many problems?

    Basically this is just a failsafe if the admin has not followed the instructions and deployed the app correctly...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  10. #10
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    If I am correct, it are the default settings after an install of Windows NT, Windows 2000 or Windows XP.
    Unless the admin specifically changed it, no normal user can install anything. Unless the user is a power user, or an administrator you can NOT write anything to the system32 directory BY DEFAULT.

    Here is a screenshot of the permissions on system32 on my windows 2000 pro machine.
    This is with a normal install (no admin changed it).

    Attached Images Attached Images  
    Frans

  11. #11
    Lively Member
    Join Date
    Jun 2002
    Posts
    111
    Frans is correct - the default for 2k and XP is to exclude normal users from being able to create/write to the WINNT folder. It also keeps them from updating the registries. If you want them to be able to do these things - rights will need to be granted.

    Just working the help desk - we have had lots of trouble with non-government machines where tech departments actually create non-admin users. Disables the users .ini file and other troubles - we end up having to redirect those files to some directory where users do have access. I know that they do not have access to the HKEY_Local_Machine branch - but I would assume that they can get to HKEY_Local_User (we don't use that much yet).

    I have seen some corporate users that cannot even see their Windows/WINNT folder. As the lockdown continues, it can only get worse.

  12. #12
    Member
    Join Date
    Nov 2005
    Location
    Buenos Aires, Argentina
    Posts
    44

    Re: Can I always write to the windows system directory ?

    What about \WINDOWS directory (not \WINDOWS\SYSTEM32 ) ?
    Could any user (not admin) write or modify a file there (for example a text file)?
    Last edited by myn01; Dec 3rd, 2005 at 04:34 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width