<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" >
  <channel>
  <title>LinuC（Linux技術者認定資格）＆リナックスサーバ構築設定事例</title>
  <link>https://archives.blog-mmo.com/</link>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="https://archives.blog-mmo.com/RSS/" />
  <description>◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…？</description>
  <lastBuildDate>Tue, 11 Aug 2026 04:00:53 GMT</lastBuildDate>
  <language>ja</language>
  <copyright>© Ninja Tools Inc.</copyright>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />

    <item>
    <title>【BAT】WinSCP実行</title>
    <description>
    <![CDATA[<div><span style="color: #808080; font-size: xx-small;">@echo off</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 変数定義</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;"><strong>set "TERATERM_DIR=C:\teraterm-5.4.1"</strong></span></div><div><span style="color: #808080; font-size: xx-small;"><strong>set "WINSCP_DIR=C:\WinSCP-6.5.6-Portable"</strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">color 8a</span></div><div><span style="color: #808080; font-size: xx-small;">echo *************************</span></div><div><span style="color: #808080; font-size: xx-small;">echo TERATERM_DIR</span></div><div><span style="color: #808080; font-size: xx-small;">echo *************************</span></div><div><span style="color: #808080; font-size: xx-small;">echo WINSCP_DIR</span></div><div><span style="color: #808080; font-size: xx-small;">echo *************************</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 2</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # メニュー画面の選択処理</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">:MENU</span></div><div><span style="color: #808080; font-size: xx-small;">cls</span></div><div><span style="color: #808080; font-size: xx-small;">color 02</span></div><div><span style="color: #808080; font-size: xx-small;">echo ====================================</span></div><div><span style="color: #808080; font-size: xx-small;">echo&nbsp; &nbsp;メニュー：実行する処理を選んでください</span></div><div><span style="color: #808080; font-size: xx-small;">echo ====================================</span></div><div><strong><span style="color: #808080; font-size: xx-small;">echo&nbsp; [1] Tera Term接続</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">echo&nbsp; [2] WinSCP接続</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">echo&nbsp; [q] 終了</span></strong></div><div><span style="color: #808080; font-size: xx-small;">echo ====================================</span></div><div><span style="color: #808080; font-size: xx-small;">echo.</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">set /p CHOICE="メニューから選択 : "</span></div><div><span style="color: #808080; font-size: xx-small;"><strong>if "%CHOICE%"=="1" goto RUN_01</strong></span></div><div><span style="color: #808080; font-size: xx-small;"><strong>if "%CHOICE%"=="2" goto RUN_02</strong></span></div><div><span style="color: #808080; font-size: xx-small;"><strong>if "%CHOICE%"=="q" goto TARGET_EXIT</strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 入力エラー処理</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">color 04</span></div><div><span style="color: #808080; font-size: xx-small;">echo 不正な入力です。1から3の数字を入力してください。</span></div><div><span style="color: #808080; font-size: xx-small;">pause</span></div><div><span style="color: #808080; font-size: xx-small;">goto MENU</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 処理（１）</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">:RUN_01</span></div><div><span style="color: #808080; font-size: xx-small;">color 09</span></div><div><span style="color: #808080; font-size: xx-small;">echo Tera Term マクロを起動</span></div><div><span style="color: #808080; font-size: xx-small;"><strong>"%TERATERM_DIR%\<span style="color: #0000ff;">ttpmacro.exe</span>"</strong><strong>&nbsp;<span style="color: #0000ff;">"%USERPROFILE%\Desktop\<span style="color: #ff0000;">LOGIN.ttl</span>"</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">goto TARGET_END</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 処理（２）</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">:RUN_02</span></div><div><span style="color: #808080; font-size: xx-small;">color 09</span></div><div><span style="color: #808080; font-size: xx-small;">echo WinSCP を起動</span></div><div><span style="color: #808080; font-size: xx-small;"><strong>"%WINSCP_DIR%\<span style="color: #0000ff;">WinSCP.exe</span>" <span style="color: #0000ff;">sftp://<span style="color: #ff0000;">&lt;ユーザ&gt;</span>:<span style="color: #ff0000;">&lt;パスワード&gt;</span>@<span style="color: #ff0000;">192.168.0.xx</span>/ /rawsettings SshHostKeyPolicy=ad-hoc</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">goto TARGET_END</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # メニュー画面へ遷移</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">:TARGET_END</span></div><div><span style="color: #808080; font-size: xx-small;">color 08</span></div><div><span style="color: #808080; font-size: xx-small;">echo.</span></div><div><span style="color: #808080; font-size: xx-small;">echo メニューに戻ります。</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 2</span></div><div><span style="color: #808080; font-size: xx-small;">goto MENU</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 終了処理</span></div><div><span style="color: #808080; font-size: xx-small;">REM #*************************</span></div><div><span style="color: #808080; font-size: xx-small;">:TARGET_EXIT</span></div><div><span style="color: #808080; font-size: xx-small;">color 07</span></div><div><span style="color: #808080; font-size: xx-small;">echo 終了</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 2</span></div>]]>
    </description>
    <category>Windows Script</category>
    <link>https://archives.blog-mmo.com/windows%20script/%E3%80%90bat%E3%80%91winscp%E5%AE%9F%E8%A1%8C</link>
    <pubDate>Tue, 11 Aug 2026 04:00:53 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/193</guid>
  </item>
    <item>
    <title>【Linux】Bracketed Paste Mode</title>
    <description>
    <![CDATA[<div><span style="color: #808080;"><strong><span style="font-size: xx-small;">Bracketed Paste Mode</span></strong></span><br />
<span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp;&rArr; コマンドのペースト投入で回避する方法</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp;</span></strong></span></div><div><span style="color: #333333;"><strong><span style="font-size: xx-small;">① 一時的に無効化する場合</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">（現在のターミナル画面を閉じると設定はリセットされる）</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp;<span style="color: #0000ff;">bind 'set enable-bracketed-paste <span style="color: #ff0000;">off</span>'</span></span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp;</span></strong></span></div><div><span style="color: #333333;"><strong><span style="font-size: xx-small;">② 恒久的に無効化する場合</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp;&rArr; <span style="color: #0000ff;">TERATERM.INI</span>に以下を設定する</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">BracketedSupport=<span style="color: #ff0000;">off</span></span></span></strong></span></div>]]>
    </description>
    <category>Linux コマンド</category>
    <link>https://archives.blog-mmo.com/linux%20%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/%E3%80%90linux%E3%80%91bracketed%20paste%20mode</link>
    <pubDate>Sat, 18 Jul 2026 06:32:52 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/192</guid>
  </item>
    <item>
    <title>【Linux】Ubuntu設定</title>
    <description>
    <![CDATA[<div><strong><span style="color: #808080; font-size: xx-small;">#*****************************</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ■ アップデート</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">#*****************************</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">apt</span> <span style="color: #0000ff;">update</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">apt</span> <span style="color: #0000ff;">upgrade</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">apt</span> <span style="color: #0000ff;">dist-upgrade</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">apt</span> <span style="color: #0000ff;">autoremove</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #0000ff;">reboot</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">#*****************************</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ■ SSH設定</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">#*****************************</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">apt</span> <span style="color: #0000ff;">install ssh</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">systemctl</span> <span style="color: #0000ff;">start ssh</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">sudo <span style="color: #ff0000;">systemctl</span> <span style="color: #0000ff;">status ssh</span></span></strong></div>]]>
    </description>
    <category>Linux コマンド</category>
    <link>https://archives.blog-mmo.com/linux%20%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/%E3%80%90linux%E3%80%91ubuntu%E8%A8%AD%E5%AE%9A</link>
    <pubDate>Sun, 07 Jun 2026 10:51:32 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/191</guid>
  </item>
    <item>
    <title>【TTL】ListBoxログイン②</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※※※※※※※※※※※※</strong></span></div><div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※ TTL_ログイン.ttl ※※</strong></span></div><div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※※※※※※※※※※※※</strong></span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 対象サーバ情報</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><strong><span style="font-size: xx-small; color: #808080;">strdim Server_NAME 4</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_NAME[0] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ｻｰﾊﾞ名】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_NAME[1] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ｻｰﾊﾞ名】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_NAME[2] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ｻｰﾊﾞ名】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_NAME[3] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ｻｰﾊﾞ名】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strdim Server_IPaddress 4</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_IPaddress[0] = '192.168.0.xx'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_IPaddress[1] = '192.168.0.xx'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_IPaddress[2] = '192.168.0.xx'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_IPaddress[3] = '192.168.0.xx'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strdim Server_USER 4</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_USER[0] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾕｰｻﾞID】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_USER[1] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾕｰｻﾞID】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_USER[2] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾕｰｻﾞID】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_USER[3] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾕｰｻﾞID】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strdim Server_PASS 4</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_PASS[0] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾊﾟｽﾜｰﾄﾞ】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_PASS[1] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾊﾟｽﾜｰﾄﾞ】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_PASS[2] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾊﾟｽﾜｰﾄﾞ】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">Server_PASS[3] = '</span></strong><span color="#808080" style="color: #808080;"><span style="font-size: xx-small;"><b>【ﾊﾟｽﾜｰﾄﾞ】</b></span></span><strong><span style="font-size: xx-small; color: #808080;">'</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ サーバ選択画面</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #0000ff;">getdir TTL_Path</span></div><div><span style="font-size: xx-small; color: #0000ff;">strconcat TTL_Path '\TTL_SSH.ttl'</span></div><div><span style="color: #ff0000;"><strong><span style="font-size: xx-small;">include <span style="color: #0000ff;">TTL_Path</span></span></strong></span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ ログイン後にコマンド実行</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">pause 1</span></div><div><span style="font-size: xx-small; color: #808080;">sendln</span></div><div><span style="font-size: xx-small; color: #808080;">sendln</span></div><div><span style="font-size: xx-small; color: #808080;">wait '$' '#'</span></div><div><span style="font-size: xx-small; color: #808080;">sendln</span></div><div><span style="font-size: xx-small; color: #808080;">send 'date ; uname -n ; id'</span></div><div><span style="font-size: xx-small; color: #808080;">sendln</span></div><div><span style="font-size: xx-small; color: #808080;">sendln</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※※※※※※※※※※※※</strong></span></div><div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※※TTL_SSH.ttl ※※※※</strong></span></div><div><span style="font-size: xx-small; color: #808080;"><strong>&nbsp; ※※※※※※※※※※※※※※</strong></span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 選択画面の表示</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #ff0000;">listbox '『対象を選択してください』' '【サーバ名】' <span style="color: #0000ff;">Server_NAME</span></span></strong></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 選択したresult値を取得</span></div><div><span style="font-size: xx-small; color: #ff0000;">if result &gt;= 0 then</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; paramIP = Server_IPaddress[result] ;; ■ IPアドレス</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; paramUSER = Server_USER[result]&nbsp; &nbsp; ;; ■ ユーザ名</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; paramPASS = Server_PASS[result]&nbsp; &nbsp; ;; ■ パスワード</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; LOG_File = Server_NAME[result]&nbsp; &nbsp; &nbsp;;; ■ ログファイル名</span></div><div><span style="font-size: xx-small; color: #ff0000;">else</span></div><div><span style="font-size: xx-small; color: #ff0000;">&nbsp; end</span></div><div><span style="font-size: xx-small; color: #ff0000;">endif</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSHログイン情報</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSHの認証方式の設定</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">paramAUTH = 'password'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;; ■ 認証方式の値</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">;■ INIファイルのパス設定</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">getdir macroDIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ 現在のパス取得</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat macroDIR '\TERATERM.INI'&nbsp; &nbsp;;; ■ INIファイル名</span></div><div><span style="font-size: xx-small; color: #808080;">paramINI = macroDIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ INIファイルの値</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSH接続コマンド編集</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">LoginSSH = paramIP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ IPアドレス</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ':22 /ssh /2 /auth=' ;; ■ 認証方式オプション</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramAUTH&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ 認証方式の値</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /user='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ ユーザ名オプション</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramUSER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ ユーザ名の値</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /passwd='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ パスワードオプション</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramPASS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ パスワードの値</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /F='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;; ■ INIファイルオプション</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramINI&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;; ■ INIファイルの値</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ LOGファイルの設定</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">getdir LOG_Path</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LOG_Path '\LOG\'</span></div><div><span style="font-size: xx-small; color: #808080;">getdate LogDate '_%Y%m%d-%H%M%S.log'</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LOG_File LogDate</span></div><div><span style="font-size: xx-small; color: #808080;">strconcat LOG_Path LOG_File</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSH接続ログイン</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">;; messagebox LOG_Path 'デバッグ用メッセージ'</span></div><div><span style="font-size: xx-small; color: #0000ff;">connect LoginSSH</span></div><div><span style="font-size: xx-small; color: #0000ff;">logopen LOG_Path 0 0</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ タイトル設定</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">settitle LOG_Path</span></div>]]>
    </description>
    <category>Windows Script</category>
    <link>https://archives.blog-mmo.com/windows%20script/%E3%80%90ttl%E3%80%91listbox%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E2%91%A1</link>
    <pubDate>Sat, 06 Jun 2026 02:12:12 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/190</guid>
  </item>
    <item>
    <title>【TTL】ListBoxログイン①</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSHログイン情報</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;"><strong><span style="color: #0000ff;">paramUSER = '<span style="color: #ff0000;">&lt;ユーザ名&gt;</span>'&nbsp;</span></strong> &nbsp; &nbsp; ;; ■ ユーザ名の値</span></div><div><span style="font-size: xx-small; color: #808080;"><strong><span style="color: #0000ff;">paramPASS = '<span style="color: #ff0000;">&lt;パスワード&gt;</span>'&nbsp;</span></strong> &nbsp; ;; ■ パスワードの値</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSHの認証方式の設定</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">paramAUTH = 'password'&nbsp; &nbsp; &nbsp; &nbsp; ;; ■ 認証方式の値</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ INIファイルのパス設定</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">getdir macroDIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ 現在のパス取得</span></div><div><span style="font-size: xx-small; color: #808080;"><span style="color: #0000ff;">strconcat macroDIR '\TERATERM.INI'</span> ;; ■ INIファイル名</span></div><div><span style="font-size: xx-small; color: #808080;">paramINI = macroDIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ INIファイルの値</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 表示するサーバ名の設定</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #0000ff;">strdim Server_NAME <span style="color: #ff0000;">5</span></span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_NAME[0] = '<span style="color: #ff0000;">【ｻｰﾊﾞ名】</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_NAME[1] = '<span style="color: #ff0000;">【ｻｰﾊﾞ名】</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_NAME[2] = '<span style="color: #ff0000;">【ｻｰﾊﾞ名】</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_NAME[3] = '<span style="color: #ff0000;">【ｻｰﾊﾞ名】</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;">Server_NAME[4] = '<span style="font-size: xx-small; color: #ff0000;">【ｻｰﾊﾞ名】</span></span>'</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 対象IPアドレスの設定</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #0000ff;">strdim Server_IPaddress <span style="color: #ff0000;">5</span></span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_IPaddress[0] = '<span style="font-size: xx-small; color: #ff0000;">192.168.0.xx</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_IPaddress[1] = '<span style="color: #ff0000;">192.168.0.xx</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_IPaddress[2] = '<span style="color: #ff0000;">192.168.0.xx</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_IPaddress[3] = '<span style="color: #ff0000;">192.168.0.xx</span>'</span></div><div><span style="font-size: xx-small; color: #0000ff;">Server_IPaddress[4] = '<span style="color: #ff0000;">192.168.0.xx</span>'</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 選択画面の表示</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><strong><span style="font-size: xx-small; color: #808080;"><span style="color: #ff0000;">listbox</span> <span style="color: #0000ff;">'『対象を選択してください』' '【サーバ名】' Server_NAME</span></span></strong></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ 選択したresult値を取得</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;"><span style="color: #0000ff;">if result &gt;= 0 then</span></span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; &nbsp; paramIP = Server_IPaddress[result]</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; &nbsp; LOG_File = Server_NAME[result]</span></div><div><span style="font-size: xx-small; color: #0000ff;">else</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; &nbsp; end</span></div><div><span style="font-size: xx-small; color: #0000ff;">endif</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSH接続コマンド編集</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><strong><span style="font-size: xx-small; color: #808080;">LoginSSH = paramIP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ IPアドレス</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ':22 /ssh /2 /auth=' ;; ■ 認証方式オプション</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramAUTH&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ 認証方式の値</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /user='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ ユーザ名オプション</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramUSER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ ユーザ名の値</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /passwd='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ パスワードオプション</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramPASS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;; ■ パスワードの値</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH ' /F='&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;; ■ INIファイルオプション</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LoginSSH paramINI&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;; ■ INIファイルの値</span></strong></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ SSH接続ログイン</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">connect LoginSSH</span></div><div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ LOGファイルの設定</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><strong><span style="font-size: xx-small; color: #808080;">getdir LOG_Path</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LOG_Path '\LOG\'</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">getdate LogDate '_%Y%m%d-%H%M%S.log'</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LOG_File LogDate</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">strconcat LOG_Path LOG_File</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">logopen LOG_Path 1 1</span></strong></div><div></div><div><span style="font-size: xx-small; color: #808080;">;; messagebox LOG_Path 'デバッグ用メッセージ'</span></div><div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ タイトル設定</span></div><div><span style="font-size: xx-small; color: #808080;">;-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #808080;">settitle LOG_Path</span></strong><br />
<br />
</div></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="font-size: xx-small; color: #808080;">;■ プロンプト待ち＆コマンド</span></div><div><span style="font-size: xx-small; color: #808080;">;*****************************</span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">wait '$' '#'</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">sendln</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">sendln</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">send 'date ; uname -n ; id'</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">sendln</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">sendln</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">wait '$' '#'</span></strong></span></div><div><span style="color: #808080;"><strong><span style="font-size: xx-small;">sendln</span></strong></span></div>]]>
    </description>
    <category>Windows Script</category>
    <link>https://archives.blog-mmo.com/windows%20script/%E3%80%90ttl%E3%80%91listbox%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E2%91%A0</link>
    <pubDate>Sat, 23 May 2026 05:58:04 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/189</guid>
  </item>
    <item>
    <title>【PowerShell】関数オブジェクト</title>
    <description>
    <![CDATA[<div><strong><span style="color: #808080; font-size: xx-small;">REM ▼▲▼▲▼▲▼▲▼▲▼▲▼</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▼スクリプトファイル名&nbsp;&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▲『WinMerge_Excel.bat』</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">REM ▲▼▲▼▲▼▲▼▲▼▲▼▲</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">@echo off</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # conhost切替</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">if not "%1"=="am_admin" (</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; start conhost "%~f0" am_admin &amp; exit /b</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">)</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 画面サイズ設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM # カラー設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM # 文字コード設定</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">mode con: cols=120 lines=16</span></strong></div><div><span style="color: #808080; font-size: xx-small;">color 0a</span></div><div><span style="color: #808080; font-size: xx-small;">chcp 932</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # PowerShell実行</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><strong><span style="color: #808080; font-size: xx-small;">powershell -ExecutionPolicy RemoteSigned -File <span style="color: #0000ff; font-size: xx-small;">"%CD%\WinMerge_Excel.ps1"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 5</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">REM # バッチ終了処理</span></div><div><span style="color: #808080; font-size: xx-small;">REM **************************</span></div><div><span style="color: #808080; font-size: xx-small;">color 17</span></div><div><span style="color: #808080; font-size: xx-small;">cls</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">echo .</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ====== END ====== "</span></div><div><span style="color: #808080; font-size: xx-small;">echo " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">echo .</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">timeout 3</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▼▲▼▲▼▲▼▲▼▲▼▲▼</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▼スクリプトファイル名&nbsp;&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▲『WinMerge_Excel.ps1』</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;"># ▲▼▲▼▲▼▲▼▲▼▲▼▲</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ .NET クラス読込</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;">Add-Type -AssemblyName System.Windows.Forms</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 定数設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【年月日-時分秒】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$DayTime = Get-Date -Format <span style="color: #0000ff; font-size: xx-small;">"yyyyMMdd-HHmmss"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【WinMerge格納パス】</span></div><div><span style="color: #808080; font-size: xx-small;"># ※ 環境に合わせて以下のパスを設定</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$winMerge = <span style="color: #0000ff;">"C:\Program Files\WinMerge\WinMergeU.exe"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【ポップアップメッセージ】</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_1 = "★★★★★ 【WinMerge】比較元（左側）ファイルを選択 ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_2 = "★★★★★ 【WinMerge】比較先（右側）ファイルを選択 ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">$P_MSG_3 = "★★★★★ 【WinMerge】出力先を確認ください ★★★★★"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【出力メッセージ】</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_0 = " ================= "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_1 = " ※※※ 【PowerShell実行 &rArr; WinMerge】 ※※※ "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_2 = " ※※※ 比較元と比較先のファイルを確認ください ※※※ "</span></div><div><span style="color: #808080; font-size: xx-small;">$W_MSG_3 = " ====== END ====== "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【msgbox オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$msgbox = New-Object -ComObject Wscript.Shell</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【fileDialog オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$FileDialog = New-Object System.Windows.Forms.OpenFileDialog</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.Title = <span style="color: #0000ff;">"【★★★★★ 対象ファイルを選択してください ★★★★★】"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$FileDialog.Filter = <span style="color: #0000ff;">"すべてのファイル (*.*)|*.*"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.ValidateNames = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.CheckFileExists = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$fileDialog.CheckPathExists = <span style="color: #0000ff;">$true</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 関数設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【ダイアログからパス取得】</span></div><div><span style="color: #ff0000;"><strong><span style="font-size: xx-small;">function Select_File {</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($FileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; $filePath = $FileDialog.FileName</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #【アクセスチェック】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; if (Test-Path -LiteralPath $filePath) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">return $filePath</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; } else {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; Write-Error <span style="color: #0000ff;">"【*** Path ERROR ***】 : $_"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; &nbsp; &nbsp; exit</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; }</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; } else {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; Write-Host <span style="color: #0000ff;">"選択無し（キャンセル）"</span> -ForegroundColor Yellow</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; exit</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><span style="color: #ff0000;"><strong><span style="font-size: xx-small;">}</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 処理開始メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_1"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 比較元（左側）を選択</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_1")</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$PATH_L = <span style="color: #ff0000;">Select_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】比較元（左側）: $PATH_L"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 1</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 比較先（右側）を選択</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_2")</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$PATH_R = <span style="color: #ff0000;">Select_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】比較先（右側）: $PATH_R"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 確認メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_2"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">pause</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 出力先パス設定</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;"># ## $OUTPUT_Path = [Environment]::GetFolderPath("Desktop")</span></div><div><span style="color: #808080; font-size: xx-small;"># ## $OUTPUT_Path = (Get-Location).Path</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$OUTPUT_Path = $PSScriptRoot</span></strong></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">$msgbox.popup("$P_MSG_3")</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "**************************************"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】フォルダ名&nbsp; : $OUTPUT_Path"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ HTMLパス取得（生成）</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$HTML_File = <span style="color: #0000ff;">"$OUTPUT_Path\Diff_HTML_$DayTime.html"</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">Get-ChildItem | Select-Object Name, Length | ConvertTo-Html &gt; <span style="color: #0000ff;">$HTML_File</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】ＨＴＭＬ名&nbsp; : $HTML_File"</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ WinMerge 比較実行</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><strong><span style="color: #808080; font-size: xx-small;"><span style="color: #ff0000;">&amp;</span> <span style="color: #0000ff;">$winMerge</span> /r /noninteractive /or <span style="color: #0000ff;">"$HTML_File" "$PATH_L" "$PATH_R"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ WinMerge比較結果を保存する</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCELファイル名の設定】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$EXCEL_File = <span style="color: #0000ff;">"$OUTPUT_Path\Diff_Excel_$DayTime.xlsx"</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "【WinMerge】エクセル名&nbsp; : $EXCEL_File"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "**************************************"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">pause</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCEL オブジェクト生成】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel = New-Object -ComObject Excel.Application</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel.Visible = <span style="color: #0000ff;">$false</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">$excel.DisplayAlerts = <span style="color: #0000ff;">$false</span></span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">#【EXCEL ファイル保存処理】</span></div><div><strong><span style="color: #808080; font-size: xx-small;">try {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $workbook = $excel.Workbooks.Open(<span style="color: #0000ff;">$HTML_File</span>)</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $fileFormat = <span style="color: #0000ff;">51</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; $workbook.SaveAs(<span style="color: #0000ff;">$EXCEL_File,$fileFormat</span>)</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host "【*** Excel保存完了 ***】 $EXCEL_File" -ForegroundColor Green</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">}</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">catch {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Error "【*** EXCEL ERROR ***】 : $_"</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">}</span></strong></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ オブジェクト解放処理</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">finally {</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【EXCEL オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($workbook) {&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; <span style="color: #0000ff;">$workbook.Close($false)</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$excel.Quit()</span></span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; [System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel) | Out-Null</span></strong></span></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; Remove-Variable excel</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【fileDialog オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$fileDialog.Dispose()</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp;</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; #【msgbox オブジェクト解放】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; <span style="color: #0000ff;">$msgbox = $null</span></span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; if ($null -ne $msgbox) {</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; [System.Runtime.InteropServices.Marshal]::ReleaseComObject($msgbox) | Out-Null</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #-----------------------------</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; #【ガベージコレクション強制】</span></strong></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; &nbsp; <span style="color: #0000ff;">[System.GC]::Collect()</span></span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">&nbsp; &nbsp; [System.GC]::WaitForPendingFinalizers()</span></strong></span></div><div><strong><span style="color: #808080; font-size: xx-small;">&nbsp; }</span></strong></div><div><span style="color: #0000ff;"><strong><span style="font-size: xx-small;">}</span></strong></span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">#******************************</span></div><div><span style="color: #808080; font-size: xx-small;"># ■ 処理終了メッセージ表示</span></div><div><span style="color: #808080; font-size: xx-small;">#-----------------------------</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_0"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_3"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host "$W_MSG_0"</span></div><div><span style="color: #808080; font-size: xx-small;">Write-Host " "</span></div><div><span style="color: #808080; font-size: xx-small;">&nbsp;</span></div><div><span style="color: #808080; font-size: xx-small;">Start-Sleep 2</span></div>]]>
    </description>
    <category>PowerShell</category>
    <link>https://archives.blog-mmo.com/powershell/%E3%80%90powershell%E3%80%91%E9%96%A2%E6%95%B0%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88</link>
    <pubDate>Sat, 09 May 2026 04:55:42 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/187</guid>
  </item>
    <item>
    <title>【awk】列の合計</title>
    <description>
    <![CDATA[<div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【ls 結果サイズを合計する】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {print sum}</span>'</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp;</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【画面表示＆ファイルに保存】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {print sum}</span>' | tee result.txt</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp;</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#【MB単位＆小数点以下2桁】</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">#*****************************</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">ls -l | <span style="color: #0000ff;">awk '{sum += <span style="color: #ff0000;">$5</span>} <span style="color: #ff0000;">END {printf "<span style="color: #0000ff;">%.2f MB\n</span>", sum<span style="color: #0000ff;">/1024/1024</span>}</span>'</span></span></strong></div>]]>
    </description>
    <category>Linux コマンド</category>
    <link>https://archives.blog-mmo.com/linux%20%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89/%E3%80%90awk%E3%80%91%E5%88%97%E3%81%AE%E5%90%88%E8%A8%88</link>
    <pubDate>Wed, 06 May 2026 06:23:14 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/188</guid>
  </item>
    <item>
    <title>【PowerShell】WinMarge</title>
    <description>
    <![CDATA[<div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■『WinMerge_Excel.bat』で以下を保存する</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><span style="font-size: xx-small; color: #808080;">@echo off</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # conhost切替</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #0000ff;">if not "%1"=="am_admin" (</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; &nbsp; start conhost "%~f0" am_admin &amp; exit /b</span></div><div><span style="font-size: xx-small; color: #0000ff;">)</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # 画面サイズ設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM # カラー設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM # 文字コード設定</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">mode con: cols=120 lines=16</span></div><div><span style="font-size: xx-small; color: #808080;">color 0a</span></div><div><span style="font-size: xx-small; color: #808080;">chcp 932</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">timeout 1</span></div><div><span style="font-size: xx-small; color: #808080;">echo "====== START ======"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><span style="font-size: xx-small; color: #808080;">REM # PowerShell実行</span></div><div><span style="font-size: xx-small; color: #808080;">REM **************************</span></div><div><strong><span style="font-size: xx-small; color: #ff0000;">powershell -ExecutionPolicy RemoteSigned -File "<span style="color: #0000ff;">%USERPROFILE%\Desktop\</span>PowerShell_WinMerge\WinMerge_Excel.ps1"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">color 17</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">echo "====== E N D ======"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">timeout 5</span></div><div></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■『WinMerge_Excel.ps1』で以下を保存する</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">■■■■■■■■■■■■■■■</span></strong></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 【 PowerShellで、WinMergeの比較を実行 】 ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 【 比較結果をExcelファイルに保存する&nbsp; 】 ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Start-Sleep 2</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ .NET クラス読込</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">Add-Type -AssemblyName System.Windows.Forms</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 定数設定</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【ダイアログ】</span></div><div><span style="font-size: xx-small; color: #0000ff;">$fileDialog = New-Object System.Windows.Forms.OpenFileDialog</span></div><div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;"><span color="#0000ff" style="color: #0000ff;"><span style="font-size: xx-small;">$fileDialog.Title = "</span></span><span style="color: #808080;">【★★★★★ 対象ファイルを選択してください ★★★★★】</span><span color="#0000ff" style="color: #0000ff;"><span style="font-size: xx-small;">"</span></span><br />
</span></span><div><span color="#0000ff" style="color: #0000ff; font-size: xx-small;"><span color="#0000ff" style="color: #0000ff;">$fileDialog.Filter = "すべてのファイル (*.*)|*.*"</span></span></div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;"></span></span><div><span color="#0000ff" style="color: #0000ff; font-size: xx-small;">$fileDialog.ValidateNames = $false</span></div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;"></span></span><div><span color="#0000ff" style="color: #0000ff; font-size: xx-small;">$fileDialog.CheckFileExists = $false</span></div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;"></span></span><div><span color="#0000ff" style="color: #0000ff; font-size: xx-small;">$fileDialog.CheckPathExists = $true</span></div><span style="font-size: xx-small; color: #0000ff;"><span style="font-size: xx-small; color: #0000ff;"></span></span><div><span color="#0000ff" style="color: #0000ff; font-size: xx-small;"><span color="#0000ff" style="color: #0000ff;">$fileDialog.RestoreDirectory = $true</span></span></div></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【メッセージボックス】</span></div><div><span style="font-size: xx-small; color: #0000ff;">$msgbox = new-object -comobject wscript.shell</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【年月日-時分秒】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$DayTime = Get-Date -Format "<span style="color: #ff0000;">yyyyMMdd-HHmmss</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【WinMerge格納パス】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$winMerge = "<span style="color: #ff0000;">C:\Program Files\WinMerge\WinMergeU.exe</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 比較元（左側）を選択</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】比較元（左側）ファイルを選択 ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【左側（比較元）パス取得】</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">if ($fileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; $selectedFile = $fileDialog.FileName</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【WinMerge】比較元（左側）: $selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">} else {</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "選択無し（キャンセル）"</span></div><div><span style="font-size: xx-small; color: #808080;">}</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【左側（比較元）を変数に格納】</span></div><div><span style="font-size: xx-small; color: #808080;">$PATH_L = "$selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 比較先（右側）を選択</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】比較先（右側）ファイルを選択 ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【右側（比較先）パス取得】</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #0000ff;">if ($fileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {</span></div><div><span style="font-size: xx-small; color: #0000ff;">&nbsp; $selectedFile = $fileDialog.FileName</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【WinMerge】比較先（右側）: $selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">} else {</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "選択無し（キャンセル）"</span></div><div><span style="font-size: xx-small; color: #808080;">}</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【右側（比較先）を変数に格納】</span></div><div><span style="font-size: xx-small; color: #808080;">$PATH_R = "$selectedFile"</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 確認メッセージ表示</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " ※※※ 比較元と比較先のファイルを確認ください ※※※ "</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">pause</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ 出力先パス設定</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;"># ## $OUTPUT_Path = [Environment]::GetFolderPath("Desktop")</span></div><div><span style="font-size: xx-small; color: #808080;"># ## $OUTPUT_Path = (Get-Location).Path</span></div><div><span style="font-size: xx-small; color: #0000ff;">$OUTPUT_Path = <span style="color: #ff0000;">$PSScriptRoot</span></span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">$msgbox.popup("★★★★★ 【WinMerge】出力先を確認ください ★★★★★")</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "**************************************"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力先パス&nbsp; : $OUTPUT_Path"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ HTMLパス取得（生成）</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$HTML_File = "<span style="color: #ff0000;">$OUTPUT_Path\File_HTML_<span style="color: #0000ff;">$DayTime</span>.html</span>"</span></strong></div><div><span style="font-size: xx-small; color: #0000ff;">Get-ChildItem | Select-Object Name, Length | ConvertTo-Html &gt; $HTML_File</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力HTML名&nbsp; : $HTML_File"</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ WinMerge 比較実行</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><strong><span style="font-size: xx-small; color: #ff0000;">&amp; <span style="color: #0000ff;">$winMerge</span> /r /noninteractive /or <span style="color: #0000ff;">$HTML_File $PATH_L $PATH_R</span></span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; #******************************</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; # ■ エクセル表示</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; #-----------------------------</span></div><div><span style="font-size: xx-small; color: #999999;">&nbsp; # ## Start-Process "excel.exe" $HTML_File</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#******************************</span></div><div><span style="font-size: xx-small; color: #808080;"># ■ WinMerge比較結果を保存する</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCELファイル名の設定】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$EXCEL_File = "<span style="color: #ff0000;">$OUTPUT_Path\File_Excel_<span style="color: #0000ff;">$DayTime</span>.xlsx</span>"</span></strong></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "【WinMerge】出力EXCEL名 : $EXCEL_File"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host "**************************************"</span></div><div><span style="font-size: xx-small; color: #808080;">Write-Host " "</span></div><div><span style="font-size: xx-small; color: #808080;">pause</span></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL オブジェクト生成】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel = New-Object -ComObject Excel.Application</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel.Visible = $false</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">$excel.DisplayAlerts = $false</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL ファイル保存処理】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">try {</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $workbook = $excel.Workbooks.Open($HTML_File)</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $fileFormat = <span style="color: #ff0000;">51</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $workbook.SaveAs($EXCEL_File,$fileFormat)</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host "【*** Excelファイル保存完了 ***】 $EXCEL_File" -ForegroundColor Green</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">}</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">catch {</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; <span style="color: #0000ff;">Write-Error "<span style="color: #808080;">【*** ERROR ***】 :</span> $_" -ForegroundColor Red</span></span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">&nbsp; Write-Host " "</span></strong></div><div><strong><span style="font-size: xx-small; color: #808080;">}</span></strong></div><div><span style="font-size: xx-small; color: #808080;">&nbsp;</span></div><div><span style="font-size: xx-small; color: #808080;">#-----------------------------</span></div><div><span style="font-size: xx-small; color: #808080;">#【EXCEL オブジェクト解放】</span></div><div><strong><span style="font-size: xx-small; color: #0000ff;">finally {</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; if ($workbook) { $workbook.Close($false) }</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; $excel.Quit()</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; [System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel) | Out-Null</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">&nbsp; Remove-Variable excel</span></strong></div><div><strong><span style="font-size: xx-small; color: #0000ff;">}</span></strong></div>]]>
    </description>
    <category>PowerShell</category>
    <link>https://archives.blog-mmo.com/powershell/%E3%80%90powershell%E3%80%91winmarge</link>
    <pubDate>Wed, 29 Apr 2026 13:20:45 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/186</guid>
  </item>
    <item>
    <title>【LinuC-3 304試験 バージョン2.0 合格】</title>
    <description>
    <![CDATA[<div><span style="font-size: small; color: #999999;"><strong>【報告】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・2026/03/14（土）</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　<span style="color: #0000ff;">LinuCレベル3 304 Virtualization &amp; High Availability</span> <span style="color: #ff0000;">合格</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　　<a target="_blank" href="//archives.blog-mmo.com/File/67666bf4.png" title=""><span style="color: #999999;"><img src="//archives.blog-mmo.com/Img/1773551381/" alt="" /></span></a> </strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;<br />
【得点】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・600点（合格ライン 520点）</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【感想】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・よく分からん内容を問われる試験問題だった</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・以下だけは覚えておくと点数稼げるかも</strong></span></div><div><span style="font-size: small;"><strong>　　　<span style="font-size: xx-small; color: #0000ff;">稼働率（可用性）を求める以下の計算式</span></strong></span></div><div><span style="font-size: small;"><strong>　　　　　<span style="font-size: xx-small; color: #0000ff;">MTBF&divide;(MTBF+MTTR)</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　　　<span style="font-size: xx-small;">※仮想化技術とは直接関係ないけど重要な知識</span></strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【その他】</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・次は考え中・・・</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>&nbsp;</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>【試験に役立つアドバイス】<br />
　・参考書籍はLinuC用が見つからず、LPICで代用</strong></span></div><div><span style="font-size: small; color: #999999;"><strong>　・Ping-t サイトで演習しまくる</strong></span></div>]]>
    </description>
    <category>管理者メモ</category>
    <link>https://archives.blog-mmo.com/%E7%AE%A1%E7%90%86%E8%80%85%E3%83%A1%E3%83%A2/%E3%80%90linuc%E3%80%91linuc-3%20304%E8%A9%A6%E9%A8%93%20%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B32.0</link>
    <pubDate>Sun, 15 Mar 2026 04:52:28 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/185</guid>
  </item>
    <item>
    <title>【仮想】保存／復元コマンド</title>
    <description>
    <![CDATA[<div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン 保存＆復元</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">xl save&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; （停止して保存）</span></div><div><span style="font-size: xx-small;">xl restore&nbsp; &nbsp; &nbsp; （復元して起動）</span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;">virsh save&nbsp; &nbsp; &nbsp;（停止して保存）</span></div><div><span style="font-size: xx-small;">virsh restore （復元して起動）</span></div><div><span style="font-size: xx-small;">&nbsp;</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;"># 仮想マシン スナップショット</span></div><div><span style="font-size: xx-small;">#*****************************</span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>snapshot-create-as</strong></span>（作成）</span></span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><strong><span style="color: #ff0000;">snapshot-revert&nbsp;</span></strong> &nbsp; &nbsp; （復元</span>）</span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>snapshot-delete</strong></span>&nbsp; &nbsp; &nbsp;（削除）</span></span></div><div><span style="font-size: xx-small;">virsh <span style="color: #0000ff;"><strong><span style="color: #ff0000;">snapshot-list</span></strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;（一覧）</span></span></div><div><span style="font-size: xx-small;">#-----------------------------</span></div><div><span style="font-size: xx-small;"><span style="color: #808080;">QEMUﾓﾆﾀｺﾏﾝﾄﾞ</span> <span style="color: #0000ff;"><strong><span style="color: #ff0000;">savevm</span></strong> （作成）</span></span></div><div><span style="font-size: xx-small;"><span style="color: #808080;">QEMUﾓﾆﾀｺﾏﾝﾄﾞ</span> <span style="color: #0000ff;"><span style="color: #ff0000;"><strong>loadvm</strong></span>&nbsp; （適用）</span></span></div>]]>
    </description>
    <category>仮想化メモ</category>
    <link>https://archives.blog-mmo.com/%E4%BB%AE%E6%83%B3%E5%8C%96%E3%83%A1%E3%83%A2/%E3%80%90%E4%BB%AE%E6%83%B3%E3%80%91%E4%BF%9D%E5%AD%98%EF%BC%8F%E5%BE%A9%E5%85%83%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89</link>
    <pubDate>Mon, 02 Mar 2026 09:08:34 GMT</pubDate>
    <guid isPermaLink="false">archives.blog-mmo.com://entry/184</guid>
  </item>

    </channel>
</rss>