@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"