G
Guest
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
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