2017년 1월 24일 화요일

VHD 마운트, 언마운트 스크립트

1. vhd 마운트

@echo off
pushd %~dp0

echo select vdisk file=c:\imges.vhd > "%temp%\Script.txt"
echo attach vdisk >> "%temp%\Script.txt"
echo exit >> "%temp%\Script.txt"

diskpart /s "%temp%\Script.txt"

del "%temp%\Script.txt" /q

exit



2. vhd 언마운트

@echo off
pushd %~dp0

echo select vdisk file=c:\imges.vhd > "%temp%\Script.txt"
echo detach vdisk >> "%temp%\Script.txt"
echo exit >> "%temp%\Script.txt"

diskpart /s "%temp%\Script.txt"

del "%temp%\Script.txt" /q

exit

2013년 8월 2일 금요일

문자열 변환


  • TCHAR -> wstring -> string -> String
    • Initialize TCHAR array
      TCHAR arryTCHAR[1024];
      arryTCHAR = L"strings";
    • Convert TCHAR array to wstringwstring alice(&arryTCHAR[0]);
    • Convert wstring to stringstring bob( alice.begin(), alice.end() );
    • Convert string to String
      String charlie = String(bob.c_str());