' 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
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
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