古いエクセルファイルを動かしたら、
Application.Run(“ATPVBAEN.XLA!COMPLEX”, r, q)
の部分でエラーがでた。
XLAMに直せば動かくかと思ったら、駄目だったので、
Application.WorksheetFunction.Complex(r, q)
このように書き換えたら動いた。
古いエクセルファイルを動かしたら、
Application.Run(“ATPVBAEN.XLA!COMPLEX”, r, q)
の部分でエラーがでた。
XLAMに直せば動かくかと思ったら、駄目だったので、
Application.WorksheetFunction.Complex(r, q)
このように書き換えたら動いた。
Change Key+AutoHotkeyで久しぶりに大きく変更した。
元々、文字入力用にIMEのON/OFF、BSをスペースの左右に配置していたが、Chrome操作などで左Altも多用しており、元の位置だと親指に負担だった。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
ProcessSetPriority "High" SetMouseDelay -1 SendMode "Input" A_MaxHotkeysPerInterval := 200 InstallKeybdHook #UseHook CoordMode "Mouse", "Window" ;-------------------------------------------------------- ; "C:\Program Files (x86)\Google\Google Japanese Input\GoogleIMEJaTool.exe" -mode=config_dialog ; Hiragana>IMEを有効化 ; Muhenkan>IMEを無効化 ; エントリーを削除 ; Henkan ; Shift Henkan ; Shift Muhenkan ;-------------------------------------------------------- >+4::Send "{Enter}" >+7::Send "{Home}" >+8::Send "{End}" >+q::Send "{&}" >+w::Send "{'}" >+e::Send "{``}" >+a::Send "{^}" >+s::Send "{$}" >+d::Send "{~}" >+u::Send "{|}" >+i::Send "{\}" >+o::Send "{@}" >+p::Send "{`%}" >+n::Send "{(}" >+m::Send "{)}" >+h::Send "{Left}" >+j::Send "{Down}" >+k::Send "{Up}" >+l::Send "{Right}" >+Backspace::Send "{Delete}" ;-------------------------------------------------------- ~sc07B:: { If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey) { Send "{sc070}" } } sc07B & 1::Send "{F12}" sc07B & 2::Send "{F2}" sc07B & q::Send "{Esc}" sc07B & w::Send "{LWin}" sc07B & e::Run "explorer.exe" sc07B & r::Send "#r" ;-------------------------------------------------------- ~^c:: { If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey) { Send "{End}+{Home}^c" } } ;-------------------------------------------------------- sc079 & RShift::Send "#{Tab}" sc079 & 1::Send "#^{Left}" sc079 & 2::Send "#^{Right}" sc079 & 3::Send "^{Home}" sc079 & 4::Send "^{End}" sc079 & q::Send "!{Left}" ; 戻る sc079 & w::Send "!{Right}" ; 進む sc079 & e::Send "^w" ; 閉じる sc079 & r::AltTab sc079 & a::Send "^+{Tab}" ; 前のタブ sc079 & s::Send "^{Tab}" ; 次のタブ sc079 & d::Send "^+t" ; 再び開く sc079 & f::Send "^{F5}" ; 更新 sc079 & z::Send "!+z" ; Alt+Shift+Z / CloseRightTabs sc079 & x::DispChange(-SysGet(16)) sc079 & c::DispChange(0) DispChange(x) { w := SysGet(16) h := SysGet(17)+15 y := 5 this_id := WinGetID("A") If (WinGetMinMax(this_id) = 1) { WinRestore(this_id) } WinMove(x,y,w,h,this_id) } sc079 & v:: { static keyDownCount If (A_PriorHotkey = A_ThisHotkey && 500 > A_TimeSincePriorHotkey) { keyDownCount += 1 If (keyDownCount > 1) { keyDownCount := 0 } } Else { keyDownCount := 0 } this_id := WinGetID("A") If (keyDownCount = 0) { If (WinGetMinMax(this_id) = 1) { WinRestore(this_id) WinMove(,,1100,750,this_id) } WinGetPos(,,&w,&h,this_id) MouseMove(w//2, 9) } Else If (keyDownCount = 1) { WinGetPos(,,&w,&h,this_id) MouseMove(w-5, h-5) } } sc079 & Left::Send "#^{Left}" sc079 & Right::Send "#^{Right}" ;-------------------------------------------------------- sc079 & WheelUp::Send "{PgUp}" sc079 & WheelDown::Send "{PgDn}" +WheelUp::WheelLeft +WheelDown::WheelRight ;-------------------------------------------------------- #HotIf WinActive("ahk_exe excel.exe") sc079 & a::Send "^{PgUp}" ; 前のタブ sc079 & s::Send "^{PgDn}" ; 次のタブ sc079 & f::Send "^+{L}" +sc079::Send "^e" ; オリジナルマクロ用 +Space:: { Send "{sc07B}" Send "+{Space}" } MButton::Send "{F4}" #HotIf WinActive("ahk_exe mpc-be64.exe") sc079 & a::Send "^{PgUp}" ; 前のタブ sc079 & s::Send "^{PgDn}" ; 次のタブ #HotIf |
●通常ログイン
1 2 3 4 5 6 7 8 9 10 11 12 13 |
@echo off set srv=192.168.1.2 set usr=user set pwd=1234 cmdkey /delete:termsrv/%srv% cmdkey /generic:termsrv/%srv% /user:%usr% /pass:%pwd% start mstsc /v:%srv% /w:1600 /h:900 timeout 2 cmdkey /delete:termsrv/%srv% |
●EntraIDログイン
EntraIDでログインしているPCは上記バッチだと接続できない。
mstscを起動し、設定後、名前を付けて保存でrdpファイルを作成する。
作成したrdpファイルをエディタで開き以下を追加
enablecredsspsupport:i:0
username:s:\AzureAD\[xxx@xxx.com]
password 1:b:[xxx]
パスワードは端末ごとに生成する。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Add-Type -AssemblyName System.Security # 平文のパスワード $plaintextPassword = "123" # パスワードをバイト配列に変換 $passwordBytes = [System.Text.Encoding]::Unicode.GetBytes($plaintextPassword) # 暗号化のスコープ $scope = [System.Security.Cryptography.DataProtectionScope]::CurrentUser # パスワードの暗号化 $encryptedData = [System.Security.Cryptography.ProtectedData]::Protect($passwordBytes, $null, $scope) # 暗号化されたデータを16進数文字列に変換 $hexString = [System.BitConverter]::ToString($encryptedData) -replace '-', '' # 16進数文字列をクリップボードにコピー "password 51:b:" + $hexString | clip |
ESETを利用しているPCへ別の拠点からVPN経由でリモート接続できなかった。
接続する側のPCの仮想NIC(VPN用)のIPアドレスをESETの信頼ゾーンに追加することで接続できた。
ESET/詳細設定>ネットワーク保護>ゾーン>編集
信頼ゾーン:192.168.113.1/255.255.255.0
追加するIPアドレスは
192.168.0.0/16
のようにも書ける。
ちょうど最近、同じく繋がらなかった端末は、
Windows Updateの影響でFirewallが別セグメントを弾いていた。
コメントが見づらかったので。CSS当てている場所は適当。
manifest.json
1 2 3 4 5 6 7 8 9 10 11 |
{ "manifest_version": 3, "name": "MyCSS", "version": "0.0.1", "content_scripts":[ { "matches": ["https://www.youtube.com/watch?v=*"], "css": ["style.css"] } ] } |
style.css
1 2 3 |
* { --ytd-watch-flexy-chat-max-height:830px; } |
この書き方の問題は一度リロードが必要になってしまうこと。リロードしなくてもCSSが当たるようする。
1 2 3 4 5 6 7 8 |
{ "manifest_version": 3, "name": "BackgroundCSS", "version": "1", "background": {"service_worker": "style.js"}, "permissions": ["tabs","scripting"], "host_permissions": ["https://www.youtube.com/"] } |
1 2 3 4 5 6 7 8 9 10 11 12 |
chrome.tabs.onUpdated.addListener(function(tabId, info, tab){ if (info.status === 'complete' && tab.url.indexOf('youtube.com/watch') !== -1) { chrome.scripting.executeScript({ target: {tabId: tab.id}, func: () => { var e = document.createElement('style'); e.textContent = "*{--ytd-watch-flexy-chat-max-height:830px;}"; document.head.insertAdjacentElement('afterbegin', e); } }); } }); |
サイトによっては以下のような書き方でも当たる。
1 2 3 4 5 6 7 8 9 10 11 |
{ "manifest_version": 3, "name": "MyCSS", "version": "1", "content_scripts":[ { "matches": ["https://www.notion.so/*"], "js": ["style.js"] } ] } |
1 2 3 4 5 |
window.addEventListener('load', function() { var e = document.createElement('style'); e.textContent = "*{font-family:'Roboto','Meiryo' !important;}"; document.head.insertAdjacentElement('afterbegin', e); }, false); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$sourceFolders = @( "C:\Users\xxx\Desktop\a", "C:\Users\xxx\Desktop\aaa" ) $targetFolder = Join-Path "C:\Users\xxx\Desktop\x" (Get-Date).DayOfWeek.value__ if (Test-Path $targetFolder) { Remove-Item $targetFolder -Recurse -Force } New-Item -ItemType Directory -Path $targetFolder | Out-Null foreach ($sourceFolder in $sourceFolders) { if (!(Test-Path $sourceFolder)) { continue } $backupFolder = Join-Path $targetFolder (Split-Path $sourceFolder -Leaf) New-Item -ItemType Directory -Path $backupFolder | Out-Null Copy-Item $sourceFolder\* $backupFolder -Recurse -Force } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!x:: { if (WinActive("ahk_exe chrome.exe") != 0) { Send "!+e" ; Chrome拡張 } for this_id in WinGetList("ahk_exe chrome.exe") { If (WinExist(this_id) != 0 && WinGetMinMax(this_id) = 0) { WinClose(this_id) } } } |
1 2 3 4 5 6 7 8 9 |
~WheelUp:: ~WheelDown:: { if (A_PriorHotkey == "" || 500 < A_TimeSincePriorHotkey) { MouseGetPos ,, &this_id WinActivate("ahk_id" this_id) } } |
プルダウンでスクロールすると閉じてしまうなどあるので注意。
ファイル>オプション>トラストセンター>トラストセンターの設定>マクロの設定>すべてのマクロを有効にする
※デジタル署名が上手くいかないとき
ファイル>オプション>リボンのユーザー設定>(右側)開発にチェック
(上部に開発メニューがー表示されるので)
開発>Visual Basic>ThisOutlookSession(ダブルクリック)
1 2 3 4 5 6 7 8 9 |
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If InStr(Item.Subject & Item.Body, "添付") > 0 And Item.Attachments.Count = 0 Then If MsgBox("ファイルが添付されていないようです。本当に送信しますか?", vbYesNo) = vbNo Then Cancel = True End If End Sub |
を貼り付けて、保存。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
function onEdit(e) { // セルの編集イベントで発火させる場合 return; let r = e.range.getRow(); let c = e.range.getColumn(); if (r == 2 && (c == 2 || c == 3)) { setFilter(); // toast表示する場合 SpreadsheetApp.getActiveSpreadsheet().toast("フィルタ設定完了しました。",""); } } function clearFilter() { let s = SpreadsheetApp.getActiveSheet(); let f = s.getFilter(); if (f) f.remove(); } function setFilter() { let s = SpreadsheetApp.getActiveSheet(); let f = s.getFilter(); if (f) f.remove(); let v1 = s.getRange("B2").getValue(); let v2 = s.getRange("C2").getValue(); if (v1 == "" && v2 == "") return; f = s.getRange("B5:H" + s.getLastRow()).createFilter(); let lock = LockService.getDocumentLock(); try { lock.waitLock(10000) if (v1 != "") f.setColumnFilterCriteria(2, SpreadsheetApp.newFilterCriteria().whenTextContains(v1).build()); if (v2 != "") f.setColumnFilterCriteria(3, SpreadsheetApp.newFilterCriteria().whenTextContains(v2).build()); } finally { lock.releaseLock(); } } |