- 追加された行はこの色です。
- 削除された行はこの色です。
→言語・開発環境
→バッチファイル
→Windowsコマンド
#contents
*PowerShell/MSH/Monad [#dba0b7b2]
-[[PowerShellのprompt関数について - Qiita>https://qiita.com/SAITO_Keita/items/47eb86a6d5dc5f928608]] 2022.11
-[[Month of PowerShell - Offensive PowerShell with Metasploit Meterpreter | SANS Institute>https://www.sans.org/blog/offensive-powershell-metasploit-meterpreter/]] 2022.7
--Arp, Ping Sweep, Port Scan,SMB,
-[[Month of PowerShell - Renaming Groups of Files | SANS Institute>https://www.sans.org/blog/renaming-groups-files/]] 2022.7
--[[Powershell Operators $() - PowerShell - SS64.com>https://ss64.com/ps/syntax-operators.html]]
-[[Month of PowerShell - PowerShell Remoting, Part 1 | SANS Institute>https://www.sans.org/blog/powershell-remoting-part-1/]] 2022.7
--[[Month of PowerShell - PowerShell Remoting, Part 2 | SANS Institute>https://www.sans.org/blog/powershell-remoting-part-2/]] 2022.7
-[[Month of PowerShell - PowerShell Version of Keeper (Save Useful Command Lines) | SANS Institute>https://www.sans.org/blog/powershell-version-keeper/]] 2022.7
-[[Month of PowerShell: Process Threat Hunting, Part 1 | SANS Institute>https://www.sans.org/blog/process-threat-hunting-part-1/]] 2022.7
-[[Month of PowerShell - Recording Your Session with Start-Transcript | SANS Institute>https://www.sans.org/blog/recording-your-session-with-start-transcript/]] 2022.7
-[[Month of PowerShell - Using The Grouping Operator (a.k.a. What are all these ()?) | SANS Institute>https://www.sans.org/blog/using-the-grouping-operator/]] 2022.7
-[[Month of PowerShell - Working with the Event Log, Part 1 | SANS Institute>https://www.sans.org/blog/working-with-event-log-part-1/]] 2022.7
-[[Month of PowerShell - Windows File Server Enumeration | SANS Institute>https://www.sans.org/blog/windows-file-server-enumeration/]] 2022.7
-[[クリップボード上の画像を簡単に保存する方法 | とあるオタクの徒然日記>https://tsuredurediary.com/archives/windows-clip-board-image-save.html]] 2022.7
-[[PowerShell Core入門 - 基本コマンドの使い方(206) Webページを自動取得する | TECH+>https://news.mynavi.jp/techplus/article/powershell_core_--206/]] 2022.7
-[[Month of PowerShell: The Power of $PROFILE | SANS Institute>https://www.sans.org/blog/month-of-powershell-power-profile/]] 2022.7
-[[Month of PowerShell: Cut a Column of Text | SANS Institute>https://www.sans.org/blog/powershell-cut-a-column-of-text/]] 2022.7
-[[Month of PowerShell: Profile Hack for Easy Base64 Encoding and Decoding | SANS Institute>https://www.sans.org/blog/month-of-powershell-profile-hack-base64-encoding-decoding/]] 2022.7
-[[Month of PowerShell: Getting Object Properties for Windows Service Dependencies | SANS Institute>https://www.sans.org/blog/powershell-getting-object-properties-for-windows-service-dependencies/]] 2022.7
-[[Month of PowerShell: Abusing Get-Clipboard | SANS Institute>https://www.sans.org/blog/abusing-get-clipboard/]] 2022.7
$x=""; while($true) { $y=get-clipboard -raw; if ($x -ne $y) { Write-Host $y; $x=$y } ; Sleep 1 }
--クリップボードをフック
-[[PowerShell起動時にPSReadLineが無効になる(備忘録) - iwasiblog>https://iwasi.hatenablog.jp/entry/2020/12/13/161312]] 2022.6
-[[PowerShell 実行時の「デジタル署名されていません」エラーの対処法>https://kondeneenen.com/powershell_digitalsignature/]] 2022.3
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
-[[WindowsのPowerShellで複数のファイルの文字コードを一括変換する:Tech TIPS - @IT>https://atmarkit.itmedia.co.jp/ait/articles/0804/18/news155.html]] 2008
-[[PowerShell 7.3の試験的な機能「Cleanブロック」について | DevelopersIO>https://dev.classmethod.jp/articles/about-powershell-7-3-clean-blcok-feature/]] 2022.4
-[[PowerShell とは - PowerShell | Microsoft Docs>https://docs.microsoft.com/ja-jp/powershell/scripting/overview?view=powershell-7.2]]
-[[WindowsのコマンドラインからUSBデバイスについて調べる方法>https://www.msn.com/ja-jp/news/techandscience/windows%E3%81%AE%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%8B%E3%82%89usb%E3%83%87%E3%83%90%E3%82%A4%E3%82%B9%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E8%AA%BF%E3%81%B9%E3%82%8B%E6%96%B9%E6%B3%95/ar-AAUZtGD?ocid=winp1taskbar]] 2022.3
-[[PowerShell で フォルダの容量一覧を取得したい - tech.guitarrapc.cóm>https://tech.guitarrapc.com/entry/2013/09/26/071905]] 2013
-[[PowerShell/ディレクトリ単位でファイル容量の合計を出力する - Windowsと暮らす>https://win.just4fun.biz/?PowerShell/%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E5%8D%98%E4%BD%8D%E3%81%A7%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%AE%B9%E9%87%8F%E3%81%AE%E5%90%88%E8%A8%88%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B]] 2017
-[[常駐型PowerShellプログラムをタスクトレイに入れる - Qiita>https://qiita.com/earthdiver1/items/a0a016f636de0ba3bbc7]] 2018
-[[【PowerShell】PowerShellでC#っぽいスクリプトを組むときの覚書 - Tumbling Dice>https://outofmem.hatenablog.com/entry/2015/06/07/180422]] 2015
--memberDefinition とか
-[[[powershell]Add-TypeでDLLを確実にロードする – エンジニ屋>https://sevenb.jp/wordpress/ura/2015/11/27/1760/]] 2015
--publicKeyTokenの調べ方
-[[Excel の複数ファイル一括検索・置換 - Qiita>https://qiita.com/earthdiver1/items/f4280d161a96e20489e2]] 2020
-[[バッチファイルの中にPowerShellスクリプトを埋め込む - Qiita>https://qiita.com/earthdiver1/items/cab769aad623a03a0f2d]] 2020
-[[「マウスふるふる」の機能を実現するPowerShellスクリプトを作ってみる - INASOFT 管理人のふたこと>https://www.inasoft.org/talk/h202005a.html]] 2020
-[[裏技? ファイルの「作成日時」を変更する >https://news.mynavi.jp/article/win10tips-487/]] 2020.4
--作成日時の変更
Set-ItemProperty foo.txt -name CreationTime -value "2020/01/01 00:00:00"
--「更新日時」を変更する場合は、コマンドレットの引数「-name CreationTime」を「-name LastWriteTime」に、「アクセス日時」では「-name LastAccessTime」に変更
-[[Windows Power Shell をアップデート!Windwos7 に Power Shell 5.1をインストール>http://memories.zal.jp/WP/blog/20180208_2959.html]] 2018.2
** PowerShell の基礎 [#of68b5ff]
-[[Month of PowerShell - Keyboard Shortcuts Like a Boss | SANS Institute>https://www.sans.org/blog/keyboard-shortcuts-boss/]] 2022.7
-[[Month of PowerShell: 5 Tips for Getting Started with PowerShell | SANS Institute>https://www.sans.org/blog/getting-started-with-powershell/]] 2022.7
-[[PowerShell Core入門 - 基本コマンドの使い方|連載一覧|開発ソフトウェア|解説/事例記事>https://news.mynavi.jp/itsearch/series/devsoft/powershell_core_-.html]] 2021.11
-[[PowerShell 7.2がリリースされました | DevelopersIO>https://dev.classmethod.jp/articles/powershell-7-2-generally-available/]] 2021.11
-[[PowerShell - Windowsと暮らす>https://win.just4fun.biz/?PowerShell]]
-[[PowerShell基礎文法最速マスター - PowerShell Scripting Weblog>https://winscript.jp/powershell/202]] 2010
-[[Windows PowerShell のヘルプ>https://forsenergy.com/ja-jp/windowspowershellhelp/html/defed09e-2acd-4042-bd22-ce4bf92c2f24.htm]]
-[[Windows Powershell ファーストステップガイド>https://docs.microsoft.com/ja-jp/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-6]]
-[[Windows PowerShellを試す>http://www.atmarkit.co.jp/fdotnet/special/powershell01/powershell01_01.html]]
--[[(後編)>http://www.atmarkit.co.jp/fdotnet/special/powershell02/powershell02_01.html]]
-MSHとはWindows Vista でサポートされる新しいコマンドシェル(Monad)
-[[MSHの紹介記事@IT:http://www.atmarkit.co.jp/fdotnet/special/monad01/monad01_01.html]] 2006.4.11
-[[MSH Official Wiki:http://channel9.msdn.com/wiki/default.aspx/Channel9.MSHWiki]] 2005.8.5
-[[Windows PowerShell 入門連載一覧:CodeZine(コードジン)>https://codezine.jp/article/corner/10]] 2008
**リポジトリ [#o5dd3bd6]
-[[GitHub - PowerShell/PowerShell: PowerShell for every system!>https://github.com/PowerShell/PowerShell#get-powershell]] 2022.11
*VBScript [#y67c1cc1]
-[[VBScriptを使ってActiveDirectoryのユーザ情報を参照する | https://pnpk.net>https://pnpk.net/cms/?p=400]] 2022.7
-[[客先常駐の仕事で1%も出てこないけど知っとくとそれなりに役に立つ話をいくつか>https://qiita.com/mima_ita/items/9cdfab94386621be09ea]] 2019.7
--VBA/WSHでIE制御
--TeraTermマクロ
--HTTPSの閲覧制限を突破
--PCの管理者権限を得ずにインストールせずにmsiの中身をとりだす(管理者権限なしでインストール)
-VBScriptでクリップボードへコピー
Public Sub PutInClipboardText(ByVal str)
Dim cmd
cmd = "cmd /c ""echo " & str & "| clip"""
CreateObject("WScript.Shell").Run cmd, 0
End Sub
-[[Windowsバッチで,パソコンのCPUの温度をモニタリングしよう (WMIを使って過負荷・発熱しすぎを監視するWSHスクリプト)>http://d.hatena.ne.jp/language_and_engineering/20150516/CpuTemperatureMeasuringWshBatch]] 2015/5/16
-[[DynaCall>http://freenet-homepage.de/gborn/WSHBazaar/WSHDynaCall.htm]]
--VBScriptからWinAPIを呼びたいときに使うコンポーネント
-[[WSHからメール送信するときのメモ>http://muumoo.jp/news/2007/02/21/0wshcdo.html]]
-右クリックから出るポップアップメニューでファイルのフルパスを得るサンプル。(Windows7で最初の実行時には管理者権限が必要です)
dim args
dim toClip
dim drive
dim path
On Error Resume Next
If WScript.Arguments.Count = 0 Then
Dim objWshShell
Set objWshShell = WScript.CreateObject("WScript.Shell")
If Err.Number = 0 Then
objWshShell.RegRead("HKCR\Folder\shell\fullpathcopy\")
If Err.Number = 0 Then
objWshShell.RegDelete "HKCR\Folder\shell\fullpathcopy\command\"
objWshShell.RegDelete "HKCR\Folder\shell\fullpathcopy\"
objWshShell.RegDelete "HKCR\*\shell\fullpathcopy\command\"
objWshShell.RegDelete "HKCR\*\shell\fullpathcopy\"
WScript.Echo "右クリックメニューから削除しました。"
Else
Dim scriptPath
scriptPath = "WScript.exe """ & WScript.ScriptFullName & """ ""%1"""
objWshShell.RegWrite "HKCR\Folder\shell\fullpathcopy\", "フルパスをコピー(&F)", "REG_SZ"
objWshShell.RegWrite "HKCR\Folder\shell\fullpathcopy\command\", scriptPath, "REG_SZ"
objWshShell.RegWrite "HKCR\*\shell\fullpathcopy\", "フルパスをコピー(&F)", "REG_SZ"
objWshShell.RegWrite "HKCR\*\shell\fullpathcopy\command\", scriptPath, "REG_SZ"
WScript.Echo "右クリックメニューに登録しました。"
End If
Else
WScript.Echo "エラー: " & Err.Description
End If
Set objWshShell = Nothing
Else
args = WScript.Arguments.Item(0)
drive = Left(args, 2)
path = Right(args, Len(args) - 2)
drive = ChangeNetworkDrive(drive)
toClip = drive & path
ClipSet(toClip)
End If
On Error Goto 0
Sub ClipSet(TextData)
Dim FF
Dim TB
Set FF = CreateObject("Forms.Form.1")
If IsEmpty(FF) Then
Exit Sub
End If
Set TB = FF.Controls.Add("Forms.TextBox.1").Object
TB.MultiLine = True
TB.Text = TextData
TB.SelStart = 0
TB.SelLength = TB.TextLength
TB.Copy
Set TB = Nothing
Set FF = Nothing
End Sub
Function ChangeNetworkDrive(src)
Dim objWshNetwork ' WshNetwork オブジェクト
Dim objDrives ' ドライブ情報
Dim lngLoop ' ループカウンタ
Set objWshNetwork = WScript.CreateObject("WScript.Network")
If Err.Number = 0 Then
Set objDrives = objWshNetwork.EnumNetworkDrives
If Err.Number = 0 Then
If objDrives.Count > 0 Then
For lngLoop = 0 To objDrives.Count - 1 Step 2
If src = objDrives.Item(lngLoop) Then
ChangeNetworkDrive = objDrives.Item(lngLoop + 1)
Set objWshNetwork = Nothing
Exit Function
End If
Next
End If
End If
End If
ChangeNetworkDrive = src
Set objWshNetwork = Nothing
End Function