Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace permission from command line

Status
Not open for further replies.

tczmbara

MIS
Jan 27, 2006
51
PL
Hi Guys,
can u help me with this issue
i need to create a *.bat file (it will be starting from scheduled task :), to clean share folder - Transfer )
Script below:
************************************************************
cscript.exe /h:cscript
xcacls.vbs F:\Transfer\*.* >>F:\Logs\%DATE%_File_Owner.txt

xcacls.vbs F:\Transfer\ /G Administrators:F /F /S /T /E /L "F:\Logs\%DATE%_Take_Owner.txt"
xcacls.vbs F:\Transfer\*.* /i enable /q
************************************************************
using this script im not able to replace permissions on folders (there is no inherty)

error below:

Directory: F:\Transfer\New Folder
Granting NTFS rights (F access for This Folder, Subfolders and Files) for "BUILTIN\Administrators"
Completed successfully.
**************************************************************************

**************************************************************************
Directory: F:\Transfer\New Folder\New Folder
Error -2147217406: occurred setting Win32_LogicalFileSecuritySetting object. (Msg#501)
Error description: Not found
**************************************************************************
Error 70: occurred while in the DoTheWorkOnEverythingUnderDirectory routine. (Msg#204)
Error description: Permission denied

**************************************************************************
Directory: F:\Transfer\test_tczmbar
Error -2147217406: occurred setting Win32_LogicalFileSecuritySetting object. (Msg#501)
Error description: Not found
**************************************************************************
Error 70: occurred while in the DoTheWorkOnEverythingUnderDirectory routine. (Msg#204)
Error description: Permission denied


////////////////////////////////////////////////////////
Do U know how to solve this problem or maybe U have some tool

thx in advanced

Michal


Best Regards

Michal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top