473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Console app using MBSACLI

I have the following code that works as long as I dont add the switch -h

'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & ""
Dim sStartInfo As String = "/hf -z -s 1"
With securityprocess.StartInfo
.FileName = "C:\Program Files\Microsoft Baseline Security
Analyzer\mbsacli"
.Arguments = sStartInfo
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardOutput = True
.RedirectStandardError = True
.RedirectStandardInput = True
End With
securityprocess.Start()

Do While Not securityprocess.HasExited
securityString = securityprocess.StandardOutput.ReadLine
Console.WriteLine(securityString)
Loop
any ideas why the switch for remote fails?

thanks

Keith
Jul 21 '05 #1
4 1512

"Keith Grefski" <kg******@optonline.net> wrote in message
news:ek****************@TK2MSFTNGP14.phx.gbl...
I have the following code that works as long as I dont add the switch -h

'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & ""


What is CompName defined as?
And what error do you get?
Jul 21 '05 #2
Daniel O'Connell [C# MVP] wrote:
"Keith Grefski" <kg******@optonline.net> wrote in message
news:ek****************@TK2MSFTNGP14.phx.gbl...
I have the following code that works as long as I dont add the switch -h

'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & ""

What is CompName defined as?
And what error do you get?

CompName is defined as a string

I dont get an error it just hangs at the line
securityString = securityprocess.StandardOutput.ReadLine
and doesnt error out.

Jul 21 '05 #3

"Keith Grefski" <kg******@optonline.net> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl...
Daniel O'Connell [C# MVP] wrote:
"Keith Grefski" <kg******@optonline.net> wrote in message
news:ek****************@TK2MSFTNGP14.phx.gbl...
I have the following code that works as long as I dont add the switch -h

'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & ""

What is CompName defined as?
And what error do you get?

CompName is defined as a string

I dont get an error it just hangs at the line
securityString = securityprocess.StandardOutput.ReadLine
and doesnt error out.


Are you sure the process is generating output?
Jul 21 '05 #4
Daniel O'Connell [C# MVP] wrote:
"Keith Grefski" <kg******@optonline.net> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl...
Daniel O'Connell [C# MVP] wrote:

"Keith Grefski" <kg******@optonline.net> wrote in message
news:ek****************@TK2MSFTNGP14.phx.gbl. ..
I have the following code that works as long as I dont add the switch -h

'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & ""
What is CompName defined as?
And what error do you get?


CompName is defined as a string

I dont get an error it just hangs at the line
securityString = securityprocess.StandardOutput.ReadLine
and doesnt error out.

Are you sure the process is generating output?

Yes it does if run from the command line alone.
One interesting thing I found was that if I use the -x option to specify
where the XML file is located it does run (slowly but runs) I wonder if
vb.net has an issue with mbsacli making a web call to retrieve the xml file
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
12
by: Jarod_24 | last post by:
I got a project called "Forms" that hold some forms and stuff in my solution. A argument at startup defines wether to use a From or Console. My plan was to create a myConsole class that would...
4
by: Keith Grefski | last post by:
I have the following code that works as long as I dont add the switch -h 'Dim sStartInfo As String = "/hf -z -s 1 -h " & CompName & "" Dim sStartInfo As String = "/hf -z -s 1" With...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
2
by: SriBhargav | last post by:
Hi, I've a question on setting timeout on console.readline() I would like the user to input something through Console.readline() in 5 secs. If there is no input in that time, I would like to...
0
by: Stephen Thomas | last post by:
Hi there I wonder if any one has encountered this problem or can suggest what is wrong. I am trying the a procedure from the msn site but get the following message: Error 1 The type or...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.