【问题标题】:Move folder content from one directory to another将文件夹内容从一个目录移动到另一个目录
【发布时间】:2013-06-28 16:24:00
【问题描述】:

我有一个修补匠,他想将多个用户本地文件的内容移动到服务器上的新目录中。

c:\users\%username%\appdata\roaming\filezilla移动 给C:\users\$username.mydomain\appData\roaming\filezilla

我怎么能做到这一点?批处理文件、vb 脚本、power shell?我需要一些快速简单的东西,基本上可以复制内容。

【问题讨论】:

  • 哦,对不起。我错过了关于移动多个用户的部分。删除我的答案。

标签: powershell batch-file vbscript


【解决方案1】:

类似

for /d %%U in (C:\Users\*) do (
  robocopy /MOVE "%%U\AppData\Roaming\Filezilla" "C:\Users\%%~nU.mydomain\AppData\Roaming"
)

也许?

【讨论】:

    【解决方案2】:

    我同意Joeyrobocopy 可能是这里最好的解决方案。你也可以在 PowerShell 中使用它:

    $subFolder = "AppData\Roaming\Filezilla"
    Get-ChildItem "C:\Users" | ? { $_.PSIsContainer } | % {
      $src = Join-Path $_.FullName, $subFolder
      $dst = Join-Path $_.FullName + ".mydomain", $subFolder
      robocopy $src $dst /move /e
    }
    

    【讨论】:

      猜你喜欢
      • 2017-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-26
      • 1970-01-01
      • 2011-07-07
      • 1970-01-01
      相关资源
      最近更新 更多