Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is local administrator password is blank or not Pin
Simon P Stevens15-Jun-09 5:53
Simon P Stevens15-Jun-09 5:53 
Questionexecute script Pin
arkiboys15-Jun-09 0:24
arkiboys15-Jun-09 0:24 
AnswerRe: execute script Pin
priyanka_jns15-Jun-09 2:08
priyanka_jns15-Jun-09 2:08 
GeneralRe: execute script Pin
arkiboys15-Jun-09 2:28
arkiboys15-Jun-09 2:28 
GeneralRe: execute script Pin
Nagy Vilmos15-Jun-09 2:56
professionalNagy Vilmos15-Jun-09 2:56 
GeneralRe: execute script Pin
arkiboys15-Jun-09 3:38
arkiboys15-Jun-09 3:38 
GeneralRe: execute script Pin
Nagy Vilmos15-Jun-09 3:55
professionalNagy Vilmos15-Jun-09 3:55 
GeneralRe: execute script Pin
arkiboys15-Jun-09 20:08
arkiboys15-Jun-09 20:08 
Hello,
I created a sample.vbs script which has this in it. i.e. Wscript.echo "Hello"

The strOutPut = "Microsoft (R) Windows Script Host Version 5.6\r\nCopyright (C) Microsoft Corporation 1996-2001. All rights reserved.\r\n\r\nHello\r\n"

After reading I have now tried to do the following:

string scriptPath = @"\\" + txtTargetMachine.Text + @"\c$\sample.vbs";
//string scriptPath = @"c:\sample2.vbs";

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "cscript.exe";
//proc.StartInfo.FileName = "Wscript.exe";
proc.StartInfo.Arguments = scriptPath;
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
try
{
proc.Start();
}
catch (Exception scriptError)
{

}
proc.WaitForExit();
int exitCode = proc.ExitCode;
string strOutPut = proc.StandardOutput.ReadToEnd();
string strErr = proc.StandardError.ReadToEnd();
proc.Close();
Questionhow to clear string memory from heap without using GC Pin
rajeshsha1815-Jun-09 0:02
rajeshsha1815-Jun-09 0:02 
AnswerRe: how to clear string memory from heap without using GC Pin
Pete O'Hanlon15-Jun-09 0:08
mvePete O'Hanlon15-Jun-09 0:08 
AnswerRe: how to clear string memory from heap without using GC Pin
Rob Philpott15-Jun-09 0:48
Rob Philpott15-Jun-09 0:48 
AnswerRe: how to clear string memory from heap without using GC Pin
Simon P Stevens15-Jun-09 5:59
Simon P Stevens15-Jun-09 5:59 
Questionword like editor Pin
Mogaambo14-Jun-09 23:53
Mogaambo14-Jun-09 23:53 
AnswerRe: word like editor Pin
Nagy Vilmos15-Jun-09 2:08
professionalNagy Vilmos15-Jun-09 2:08 
GeneralRe: word like editor Pin
Mogaambo15-Jun-09 3:15
Mogaambo15-Jun-09 3:15 
GeneralRe: word like editor Pin
Pete O'Hanlon15-Jun-09 3:22
mvePete O'Hanlon15-Jun-09 3:22 
GeneralRe: word like editor Pin
Nagy Vilmos15-Jun-09 3:26
professionalNagy Vilmos15-Jun-09 3:26 
AnswerRe: word like editor Pin
K030616-Jun-09 0:35
K030616-Jun-09 0:35 
Questionabout Silverlight 3 Pin
Seraph_summer14-Jun-09 23:50
Seraph_summer14-Jun-09 23:50 
AnswerRe: about Silverlight 3 Pin
Henry Minute15-Jun-09 0:00
Henry Minute15-Jun-09 0:00 
AnswerRe: about Silverlight 3 Pin
Pete O'Hanlon15-Jun-09 0:02
mvePete O'Hanlon15-Jun-09 0:02 
AnswerRe: about Silverlight 3 Pin
Eddy Vluggen15-Jun-09 1:31
professionalEddy Vluggen15-Jun-09 1:31 
QuestionRegarding security Pin
vijaylumar14-Jun-09 23:46
vijaylumar14-Jun-09 23:46 
AnswerRe: Regarding security Pin
Henry Minute15-Jun-09 0:03
Henry Minute15-Jun-09 0:03 
GeneralRe: Regarding security Pin
vijaylumar15-Jun-09 0:53
vijaylumar15-Jun-09 0:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.