You'd be better off asking this in a newsgroup related to scripting, such as
microsoft.public.scripting.vbscript.
This newsgroup is for questions about security in Access, the database
product that's part of Office Professional.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"SunRace" <(E-Mail Removed)> wrote in message
news:9750ACC2-B1BC-4AE9-A3B4-(E-Mail Removed)...
> Hello,
>
> I am creating a txt file using following script when the user logs in. Now
> what I want to do is take ownership of that file and deny access to all
> users
> expect one group - this group will have read access to the file. I want
> domain administrators to have full rights to the file.
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objNet = CreateObject("WScript.NetWork")
>
> If NOT objFSO.FileExists("\\advad02\Profiles\Notepads\owner\" +
> objNet.UserName + ".txt") Then
>
> strPath = "\\advad02\Profiles\Notepads\owner\"
> strFileName = objNet.UserName + ".txt"
> strFullName = objFSO.BuildPath(strPath, strFileName)
> Set objFile = objFSO.CreateTextFile(strFullName)
> objFile.Close
>
> End if