WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntAccessAdd versus w95accessAdd Tips

Keywords: WntAccessAdd access NT

Question:

I would like to specify "DirNT:Read" right on a specified directory. I tried it may different ways... The last example in the following is the only one that worked.
That one used UNC instead of drive letter.
AddExtender("WWWNT34I.DLL")
server = "\\C999SRV3"
;Doesn't work with drive letter
;resdir = "D:\USERDIRS\CSYS\CSYSMEH" ;Doesn't work with drive letter
;wntAccessAdd(server,resdir,"CSYSSFG",300,"DirNT:Read")
;wntAccessAdd(server,"%resdir%","CSYSSFG",300,"DirNT:Read")
;wntAccessAdd(server,"D:\USERDIRS\CSYS\CSYSMEH","CSYSSFG",300,"DirNT:Read")

;Works with UNC
resdir = "\\C999SRV3\D$\USERDIRS\CSYS\CSYSMEH"
wntAccessAdd(server,resdir,"CSYSSFG",300,"DirNT:Read") 

Answer:

You may need to specify the UNC path for the "Resource/Sharename" parameter.
Use UNC instead of drive letter.
AddExtender("WWWNT34I.DLL")
server = "\\C999SRV3"
resdir = "\\C999SRV3\D$\USERDIRS\CSYS\CSYSMEH"
wntAccessAdd(server,resdir,"CSYSSFG",300,"DirNT:Read")
Note that the second parameter, the resource/share-name (identifies the object to be modified) does not need to be a share or a full path. I.e., you can specify a directory here.

To use wntAccessAdd to change the permissions on a file on a remote server (ie, not the local machine), you need to specify the file name as a UNC, eg:

        wntAccessAdd("server2", "\\server2\C$\test", "Everyone", 300, "DirNT:Read")
("C$" and "D$" are standard admin shares to "C:\" and "D:\", etc.)

Question:

I'm using 97b and when trying to set permissions on a drive, using a group from the domain, I get an 'invalid user/group'. Here's the line:
        wntAccessAdd("","D:\","%domain%\Administrators",300,"DirNT:Full")
I'm trying to set perms for the domain group Administrators. When I tried this specifying the localgroup Administrators -- replacing the variable 'domain' with 'boxname', I received the same error. Eliminating the variable preceeding the group solved the localgroup problem.

I am trying to add the domain group "Administrators" using wntAccessAdd. Does this function support global and local groups or only global groups? I can do anything I want with globals, but all my localgroup adds fail.

Answer:

You can't add localgroups from the domain (or any other machine, for that matter). The domain localgroup is for the Domain Controllers only! They share the same user account database, since Backup Domain Controllers back up Primary Domain Controllers.

Related Question (Error 547: Error accessing file/directory information")

I am trying to run a script which goes out and creates folders and assigns rights to groups in Windows NT. One part of the script is for people who are using WindowsNT workstation and the other for people using Windows95.

For windows Nt workstation, I am using the network extender WwwNT34I.dll, and for Windows 95 I am using WWW9x34I.dll.

When I run this script from windows NT it works fine, but when I run from 95, it goes to create the directories but when it gets to assigning rights, I get error 547 or 548. Syntax can not be wrong because the same statement runs perfectly from NT workstation.

My code NT workstation which works:

        if (groups == "Admin_Asst") then
        resdir = ("%servername%\%volname%\books\%ISBN%\author")
        wntAccessAdd(server,resdir,"Admin_Asst",300,"DirNT:READ")
and my code for Windows95 which doesn't:
        if (groups == "Admin_Asst") then
        resdir = ("%servername%\%volname%\books\%ISBN%\author")
        w9xAccessAdd(server,resdir,"Admin_Asst",300,"DirNT:READ") 
I have a group name "Admin_Asst". I am trying to see if the variable group is equal to Admin_Asst, and if it is, it should go and assign rights to the folder, Author, whose UNC path is defined in the variable resdir.

Before it does this, it goes and creates folder on the server whose name is \\carmas004, and in the NTFS directory whose share name is "prog_db". In that share there is a folder named, books, which already exists in that share, "prog_db". So the statment "resdir=" will look like this:

servername=\\carmas004
volname= prog_db
books=the folder which is already there
ISBN= the number user is inputting in the system
Author=folder which got created before this statement is run.

Answer:

I think that maybe for the w9xAccessAdd you need a hard coded c:\dir type name from THE POINT OF VIEW OF THE SERVER rather than a UNC name.

The w9x functions transfer the information to the NT machine and the AccessAdd is executed on the NT machine so it would need different path information.

Question (continued):

I looked in the WWWBATCH.INI file in the Windows directory, and found the following error: Last Error=1336(getfilesecurity). Can you give me any details on what it might indicate?

This program will run fine on another computer but on 3 computers it crashes and with the error 548 or 547. If I plug in the laptop on the same jack where it's not working from, it will work on the laptop but not on the machine which the user is using. Any ideas?

Answer:

OK, so you have determined that:
  1. It is NOT the physical location (laptop worked).

  2. Is it related to user accout? Or to machine configuration?

    (Can you log on as one of the users with your laptop?)

  3. I suspect missing or damaged OS files at this point. Try a different computer for the user or re-install the OS ?

  4. Check the user's security settings VERY VERY carefully.

Article ID:   W13571
Filename:   wntAccessAdd versus w95AccessAdd Tips.txt
File Created: 2001:03:01:14:17:24
Last Updated: 2001:03:01:14:17:24