別ユーザーでDOSコマンド実行
- 題名: 別ユーザーでDOSコマンド実行
 - 著者: seki
 - 日時: 2013/06/01 16:00:34
 - ID: 31607
 - この記事の返信元: 
 - この記事への返信: 
 - ツリーを表示
 
 
 
- 題名: Re[1]: 別ユーザーでDOSコマンド実行
 - 著者: shu
 - 日時: 2013/06/05 14:28:30
 - ID: 31608
 - この記事の返信元: 
 - この記事への返信: 
 - ツリーを表示
 
 
 
- 題名: Re[2]: 別ユーザーでDOSコマンド実行
 - 著者: seki
 - 日時: 2013/06/08 3:59:19
 - ID: 31627
 - この記事の返信元: 
 - この記事への返信: 
 - ツリーを表示
 
 
 
 
分類:[.NET]
別ユーザーでDOSコマンドを実行しようとして、以下のコードで作成しました。
-----------------------------------------------------------
Dim proc As New Process()
proc.StartInfo.UseShellExecute = False
proc.StartInfo.RedirectStandardOutput = True
proc.StartInfo.RedirectStandardInput = False
proc.StartInfo.CreateNoWindow = True
proc.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec")
proc.StartInfo.Domain = domain
proc.StartInfo.UserName = userName
proc.StartInfo.Password = password
proc.StartInfo.Arguments = "/c start http://get.adobe.com/jp/reader/otherversions/"
proc.Start()
----------------------------------------------------------------
Vista、Windows7では実行できますが、Windows XPでは、「ハンドルが無効」となり、実行できません。
Windows XP環境で、別ユーザーによるDOSコマンド実行するには、どうしたらいいでしょうか?
どなたかわかる方よろしくお願い致します。