Facebook
From Dave, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 214
  1. @echo off
  2.  
  3. set /P drachost="Host: "192.168.1.120
  4. set /p dracuser="Username: "root
  5. set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
  6.     $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
  7.         [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
  8. for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p
  9.  
  10. IF NOT EXIST "avctKVM.jar" (
  11. ECHO Grabbing avctKVM.jar from host...
  12. powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVM.jar','.avctKVM.jar')"
  13. )
  14.  
  15. IF NOT EXIST "lib" (
  16. ECHO Creating lib directory
  17. mkdir "lib"
  18. )
  19.  
  20. IF NOT EXIST ".libavmWinLib.dll" (
  21.   IF NOT EXIST ".libavctVMWin64.zip" (
  22.     IF NOT EXIST ".libavctVMWin64.jar" (
  23.       ECHO Grabbing avctKVMWin64.jar from host...
  24.       powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.libavctVMWin64.jar')"
  25.     )
  26.     ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
  27.     rename ".libavctVMWin64.jar" avctVMWin64.zip
  28.   )
  29.   ECHO Unzipping avctKVMWin64.zip
  30.   powershell Expand-Archive ".libavctVMWin64.zip" -DestinationPath ".lib"
  31.   rmdir ".libMETA-INF" /s /q
  32.   erase ".libavctVMWin64.zip" /q
  33. )
  34.  
  35. IF NOT EXIST ".libavctKVMIO.dll" (
  36.   IF NOT EXIST ".libavctKVMIOWin64.zip" (
  37.     IF NOT EXIST ".libavctKVMIOWin64.jar" (
  38.       ECHO Grabbing avctKVMIOWin64.jar from host...
  39.       powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.libavctKVMIOWin64.jar')"
  40.     )
  41.     ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
  42.     rename ".libavctKVMIOWin64.jar" avctKVMIOWin64.zip
  43.   )
  44.   ECHO Unzipping avctKVMIOWin64.zip
  45.   powershell Expand-Archive ".libavctKVMIOWin64.zip" -DestinationPath ".lib"
  46.   rmdir ".libMETA-INF" /s /q
  47.   erase ".libavctKVMIOWin64.zip" /q
  48. )
  49.  
  50. 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"