小编Rog*_*nce的帖子

在命令中使用变量(PowerShell)

$computer = gc env:computername

# Argument /RU '$computer'\admin isn't working.
SchTasks /create /SC Daily /tn "Image Verification" /ST 18:00:00 /TR C:\bdr\ImageVerification\ImageVerification.exe /RU '$computer'\admin /RP password
Run Code Online (Sandbox Code Playgroud)

基本上我需要在计划任务中提供计算机名称...

先感谢您!

variables powershell quoting string-interpolation

5
推荐指数
1
解决办法
1万
查看次数