@echo off
set /P drachost="Host: "192.168.1.120
set /p dracuser="Username: "root
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p
IF NOT EXIST "avctKVM.jar" (
ECHO Grabbing avctKVM.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVM.jar','.avctKVM.jar')"
)
IF NOT EXIST "lib" (
ECHO Creating lib directory
mkdir "lib"
)
IF NOT EXIST ".libavmWinLib.dll" (
IF NOT EXIST ".libavctVMWin64.zip" (
IF NOT EXIST ".libavctVMWin64.jar" (
ECHO Grabbing avctKVMWin64.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.libavctVMWin64.jar')"
)
ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
rename ".libavctVMWin64.jar" avctVMWin64.zip
)
ECHO Unzipping avctKVMWin64.zip
powershell Expand-Archive ".libavctVMWin64.zip" -DestinationPath ".lib"
rmdir ".libMETA-INF" /s /q
erase ".libavctVMWin64.zip" /q
)
IF NOT EXIST ".libavctKVMIO.dll" (
IF NOT EXIST ".libavctKVMIOWin64.zip" (
IF NOT EXIST ".libavctKVMIOWin64.jar" (
ECHO Grabbing avctKVMIOWin64.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.libavctKVMIOWin64.jar')"
)
ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
rename ".libavctKVMIOWin64.jar" avctKVMIOWin64.zip
)
ECHO Unzipping avctKVMIOWin64.zip
powershell Expand-Archive ".libavctKVMIOWin64.zip" -DestinationPath ".lib"
rmdir ".libMETA-INF" /s /q
erase ".libavctKVMIOWin64.zip" /q
)
java -cp avctKVM.jar -Djava.library.path=.lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}