我试图添加组Everyone并赋予它modify文件夹的权限.我正在使用批处理文件来试试这个.所以对于我有icacls "C:\Program Files (x86)\Program File" /grant:r Everyone:M
但是当我去看看文件夹的权限时,没有任何改变.
我有一个批处理文件,要求用户输入变量 line set /p asset=。我像这样调用我的 powershell 脚本
SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%file.ps
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%'";
我想知道如何从我的批处理文件中向 powershell 发送变量“资产”。
这是我的 .bat 文件内容
@Echo off
cls
Color E
cls
@echo Enter asset below
set /p asset=
@echo.
@echo your asset is %asset%
@echo.
goto startusmt
:startusmt
@echo.
@echo executing psexec ...
@echo.
SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%RemoteUSMT.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -file %PowerShellScriptPath% %asset%
psexec \\%asset% -u domain\username -p password cmd
goto EOF
:EOF
PAUSE
Run Code Online (Sandbox Code Playgroud)