- 追加された行はこの色です。
- 削除された行はこの色です。
#contents
*WSH [#n5b551b0]
**WMI [#e286805f]
-MSDN Library - WMI
--http://msdn.microsoft.com/library/en-us/dnanchor/html/anch_wmi.asp
-WMI スクリプト入門 : 第 1 部
--http://www.microsoft.com/japan/msdn/columns/scripting/scripting06112002.asp
-Windows 2000: スクリプト天国
--http://www.microsoft.com/japan/msdn/columns/scripting/scripting02142000.asp
-システム管理は楽ですか? (前編) 〜 Windows Management Instrumentation 〜
--http://www.microsoft.com/japan/msdn/thisWeek/wmi/koj990730.asp
-システム管理は楽ですか? (後編) 〜 Windows Management Instrumentation 〜
--http://www.microsoft.com/japan/msdn/thisweek/wmi/koj990811.asp
-WMIいぢり 第1回:WMIって?
--http://www.showg.jp/tamper/wmi/wmi001.htm
-WMIいぢり 番外編:サンプル集 - WMIをいぢる - ものいぢり - いつまでも構想中
--http://www.showg.jp/tamper/wmi/wmi101.htm
-演習 1 : 簡単な WMI タスク
--http://www.microsoft.com/japan/technet/prodtechnol/windowsserver2003/proddocs/entserver/prog_wmi_tut_03_01.asp
-827227 - Visual Basic スクリプトを使用してリモート ホスト コンピュータにセキュリティ修正プログラムをインストールする方法
--http://support.microsoft.com/default.aspx?scid=kb;JA;827227
-お前ら、wsh使ってますか?
--http://pc.2ch.net/win/kako/1009/10091/1009175619.html
-リモートコンピュータへアクセス
--http://wmifun.atinfinity.net/wmistep/wmistep06.html
---XP以降ではリモートコンピュータに画面は出せない仕様になったらしい。
***サンプル [#mdcee1d0]
-メモ帳を終了させるプログラム
' KillNotepad.vbs
Main
Sub Main()
For Each Process In GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_Process where Name='NOTEPAD.EXE'")
Set oProcess = Process
WScript.Echo oProcess.ExecutablePath
Process.Terminate
Next
End Sub
-隣のPCでプログラムを実行させる方法。
--http://www.users.gr.jp/ml/archive/viewer.aspx?name=wsh&no=120
Set args = Wscript.Arguments
If args.Count < 1 Then
Wscript.StdOut.WriteLine "xstart <command> [<computer>]"
Else
'--- コマンド指定
strCommand = args(0)
'--- コンピュータ指定
strComputerPath = ""
If args.Count = 2 Then
strComputer = args(1)
If InStr(strComputer, "\\") = 1 Then
strComputer = Mid(strComputer, 3)
End If
strComputerPath = "\\" & strComputer & "\root\cimv2:"
End If
'--- WMI に接続 Wim32_Process クラスを取り出す
Set clsProcess = GetObject("winmgmts:{impersonationLevel=impersonate}" _
& "!" & strComputerPath & "Win32_Process")
'--- プロセスの作成
lngResult = clsProcess.Create(strCommand)
Wscript.StdOut.WriteLine strCommand & " :" & lngResult
End If
*コマンド [#t2365cea]
**Runas [#ve64c613]
-Runas
--http://www.microsoft.com/japan/technet/prodtechnol/windowsserver2003/proddocs/entserver/runas.asp
*Visual C++ 関連情報 [#eb4e6a7a]
-マクロを展開する方法
--コンパイルオプションで「/P」を指定するとプリプロセスの処理結果が「*.i」というファイルに保存される。
cl test.cpp /P
--変換前
#code c++
int main( int argc, char* argv[] )
{
printf( "_MAX_PATH = [%d]\n", _MAX_PATH );
return 0;
}
#end
--変換後
#code c++
int main( int argc, char* argv[] )
{
printf( "_MAX_PATH = [%d]\n", 260 );
return 0;
}
#end
//#comment