473,405 Members | 2,171 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,405 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 1513

"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.