Dos

This is a discussion on Dos within the Windows Programming forums, part of the Platform Specific Boards category; is there a dos equivalent of the unix command chmod?...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    86

    Dos

    is there a dos equivalent of the unix command chmod?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Not really. What do you want to do to the files?

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    I don't think DOS supported file permissions, but if you are actually referring to Windows, you could try the cacls command.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    What do you want to do to the files?
    Give users certain rights, perhaps
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Quote Originally Posted by Magos
    Give users certain rights, perhaps
    Cute

    If he wants to make the file Read Only, then that's easy. If he wants to stop execution, then that's not so simple

  6. #6
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    I just love all this sepculation

    anyhow...

    My goal is thus

    in unix, the chmod has the flag -f

    or force mode, so that I can, in an account with not so many privaliges, force a document to give me read or write privaliges.

    my goal is to be able to, in a windows account, probably with status below "power user", five myself read and write privaliges over certain files

    can it be done? does it even need to be done?

  7. #7
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    -f in chmod doesn't force a document to give you read or write privileges. All -f does is suppress error messages.

    If the user account doesn't have admin privileges, you cant give yourself access to files which you would not otherwise have access to.

  8. #8
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    is there anyway to change account status through dos?

  9. #9
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    Use the LogonUser() API function.

  10. #10
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    You say "in a windows account" then talk about DOS. Are you working with 32 bit Windows, (no DOS involved), or DOS - it really does make a vrey big difference.

    You can create Access Control Lists for resources under WIndows which grant or deny access to specific resources to members of specific groups. It is a big area.

    Apart from some noddy tricks, you can't do that with DOS.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  11. #11
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Assuming you are using Windows, you could check out the Non-Admin blog, especially the MakeMeAdmin entry.

  12. #12
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    another dos question:

    how do I write an autorun.bat that gets started up when I pop in a CD (the .bat is on the CD)?

  13. #13
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 09:08 PM
  2. winver, winminor, winmajor can it be found from dos?
    By ronin in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-02-2002, 11:32 AM
  3. real mode dos & win dos
    By scott27349 in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-19-2002, 07:15 AM
  4. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21