【发布时间】:2015-09-23 20:04:28
【问题描述】:
我目前正在尝试运行我编写的脚本。它工作得很好,但我也需要它来搜索并从隐藏文件夹中删除。它似乎对隐藏文件夹没有任何影响...这是我的脚本。
Get-ChildItem C:\ -Include saplogon.ini -Recurse | foreach ($_) {Remove-Item $_.fullname}
$src_dir = "\\xxxxxxxxxx\xxxxxxxxxxxx\saplogon\saplogon.ini"
$dst_dir = "C:\Windows"
$file = Get-ChildItem $src_dir
Copy-Item $file -Destination $dst_dir
[System.Environment]::SetEnvironmentVariable('SAP_LOGON_INI', 'C:\Windows\saplogon.ini', 'Machine')
【问题讨论】:
-
get-childitem -force假设你有权限
标签: windows powershell appdata