2022年5月
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        
無料ブログはココログ

« PowerShellスクリプトをWSFファイルにして、ウィンドウ アプリっぽく実行する。 | トップページ | PowerShell.exeでAppActivateする1行バッチファイル »

2007年8月30日 (木)

PowerShell.exeで日本語なども通るSendKeysの1行バッチファイル

.NETで可能なことは、PowerShellでも可能です。
PowerShellで可能なら、1行バッチやインラインバッチでも可能です。

SendKeys.CMD 文字列

PowerShell.exe -command "[void][Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[Windows.Forms.SendKeys]::SendWait('%*')"

SendKeys.CMD 文字列 では、%や^に、エスケープ^が必要です。
"は、消えて、送られません。

« PowerShellスクリプトをWSFファイルにして、ウィンドウ アプリっぽく実行する。 | トップページ | PowerShell.exeでAppActivateする1行バッチファイル »