dwrcc
DameWare portable
Start-Process -FilePath "C:\Program Files (x86)\SolarWinds\Dameware Remote Support\DWRCC.exe" -ArgumentList '-c:', '-h:', '-m:VK00006469', '-u:Admin', '-p:RChS-2014', '-a:2', '-v:' -NoNewWindow Start-Process -FilePath "C:\Program Files (x86)\SolarWinds\Dameware Remote Support\DWRCC.exe" -ArgumentList '-c:', '-h:', '-m:VIP001', '-u:Administrator', '-p:362701-DKC', '-a:2', '-v:' -NoNewWindow
# Путь к DWRCC.exe относительно самого скрипта
$exePath = Join-Path $PSScriptRoot '\Dameware Remote Support\DWRCC.exe'
if (-not (Test-Path $exePath)) {
Write-Error "Файл не найден: $exePath"
exit 1
}
Start-Process -FilePath $exePath -ArgumentList @(
'-c:',
'-h:',
'-m:VK00006547',
'-u:Admin',
'-p:RChS-2014',
'-a:2',
'-v:'
) -NoNewWindow
Скрипт с выбором опций
# script.ps1
# Скрипт лежит в: DameWare\Dameware Remote Support\
# DWRCC.exe лежит там же
$exePath = Join-Path $PSScriptRoot 'Dameware Remote Support\DWRCC.exe'
if (-not (Test-Path $exePath)) {
Write-Error "Файл не найден: $exePath"
exit 1
}
function Read-MachineName {
while ($true) {
Write-Host ""
Write-Host "Выберите формат имени машины:" -ForegroundColor Cyan
Write-Host " 1) VK0000#### (пример: VK00006547)" -ForegroundColor Gray
Write-Host " 2) VIP### (пример: VIP001)" -ForegroundColor Gray
Write-Host " 3) Полное имя (пример: CENTAUR)" -ForegroundColor Gray
Write-Host " 0) Выход" -ForegroundColor DarkGray
$choice = Read-Host "Ваш выбор (0-3)"
switch ($choice) {
'1' {
do {
$suffix = (Read-Host "Введите последние 4 цифры для VK0000####").Trim()
$ok = $suffix -match '^\d{4}$'
if (-not $ok) {
Write-Host "Ошибка: нужно ввести ровно 4 цифры." -ForegroundColor Yellow
}
} while (-not $ok)
return "VK0000$suffix"
}
'2' {
do {
$suffix = (Read-Host "Введите 3 цифры для VIP###").Trim()
$ok = $suffix -match '^\d{3}$'
if (-not $ok) {
Write-Host "Ошибка: нужно ввести ровно 3 цифры." -ForegroundColor Yellow
}
} while (-not $ok)
return "VIP$suffix"
}
'3' {
do {
$name = (Read-Host "Введите полное имя машины (например, CENTAUR)").Trim().ToUpper()
# Разрешаем буквы/цифры/дефис, длина до 15 (NetBIOS)
$ok = $name -match '^[A-Z0-9-]{1,15}$'
if (-not $ok) {
Write-Host "Ошибка: допустимы A-Z, 0-9, '-', длина 1..15." -ForegroundColor Yellow
}
} while (-not $ok)
return $name
}
'0' {
Write-Host "Выход." -ForegroundColor DarkGray
exit 0
}
default {
Write-Host "Неверный выбор. Введите 0, 1, 2 или 3." -ForegroundColor Yellow
}
}
}
}
$machineName = Read-MachineName
Write-Host "Подключение к: $machineName" -ForegroundColor Green
Start-Process -FilePath $exePath -ArgumentList @(
'-c:',
'-h:',
"-m:$machineName",
'-u:Admin',
'-p:RChS-2014',
'-a:2',
'-v:'
) -NoNewWindow
Внизу в командной строке FAR: powershell -NoProfile -ExecutionPolicy Bypass -File .\script.ps1 Если стоит PowerShell 7: pwsh -NoProfile -ExecutionPolicy Bypass -File .\script.ps1 Скрипт использует $PSScriptRoot, поэтому путь будет браться от папки скрипта (удобно для флешки). Если ругнется на политику/блокировку, один раз можно выполнить: Unblock-File .\script.ps1
dwrcc.txt · Последнее изменение: — bonterkoz
