CMD - 取消给定“传递到系统调用的数据区域太小” [英] CMD - Takeown giving "The data area passed to a system call is too small"

查看:716
本文介绍了CMD - 取消给定“传递到系统调用的数据区域太小”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个脚本来重置漫游配置文件,但它在以下部分失败:

I am writing a script to reset roaming profiles and it is failing at a part which basically:


  1. 更改文件夹的所有权


  2. 复制到临时文件夹

  3. 删除原始

要更改所有权我使用takeown:

To change ownership I use takeown:

takeown /s \\profile-server /f e:\Profiles\%username% /r /d Y

一个域管理员帐户所以权限是罚款。然后得到以下输出:

This is run from a domain admin account so permissions are fine. I then get the following output:


SUCCESS:文件(或文件夹):\\profile-server\e $ \ Profiles \%username%现在由用户domain\user拥有。

SUCCESS: The file (or folder): "\\profile-server\e$\Profiles\%username%" now owned by user "domain\user".

错误:传递到系统调用的数据区太小


ERROR: The data area passed to a system call is too small

因此,它会更改最顶层文件夹的所有权,但在第一个子项目失败。

So it changes ownership of the top most folder but fails at the first sub-item.

我试过这个在网络上的2台电脑,它的工作正常,但一旦我改变电脑到配置文件服务器这个错误来了。

I have tried this on 2 computers on the network and it works fine but as soon as I change the computer to the profile server this error comes.

任何

感谢

推荐答案

必须做的是使用PsExec为了运行命令,所以:

In order to rectify this all I had to do was use PsExec in order to run the command, so:

psexec \\profileserver takeown /f e:\Profiles\%username% /r /d Y

它允许我递归获取所有文件。

And it allowed me to recursively take ownership of all the files.

这篇关于CMD - 取消给定“传递到系统调用的数据区域太小”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆