By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Questions about ProcessStartInfo

P: n/a
I use:

'Execute Command (DOS) commands

Dim StartInfo As New ProcessStartInfo

Static sMyProcess As New Process

StartInfo.FileName = "cmd"

....

1) Is there another file that runs DOS commands in XP besides cmd?

Does the XP Command prompt window use cmd or something else?

2)The @ doesn't appear to work for me. I use:

SWIn.WriteLine("@echo off")

but the command shows in the output. I believe the @ should suppress the
listing of the command in the output.

Thanks for any help


Oct 1 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
1. I don't think there is any other command for cmd.exe...
2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and not
running a batch where @ applies.
"Academia" wrote:
I use:

'Execute Command (DOS) commands

Dim StartInfo As New ProcessStartInfo

Static sMyProcess As New Process

StartInfo.FileName = "cmd"

....

1) Is there another file that runs DOS commands in XP besides cmd?

Does the XP Command prompt window use cmd or something else?

2)The @ doesn't appear to work for me. I use:

SWIn.WriteLine("@echo off")

but the command shows in the output. I believe the @ should suppress the
listing of the command in the output.

Thanks for any help


Oct 1 '07 #2

P: n/a
2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and not
running a batch where @ applies.
If this is the case you could first create the batch file with the
necessary commands and then use the Process class to execute the batch
file. Just be sure to make sure your application has adequate
permission to do so on the client machine.

Thanks,

Seth Rowe
Oct 1 '07 #3

P: n/a

All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

....

Maybe an argument??

Thanks
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
>2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and
not
running a batch where @ applies.

If this is the case you could first create the batch file with the
necessary commands and then use the Process class to execute the batch
file. Just be sure to make sure your application has adequate
permission to do so on the client machine.

Thanks,

Seth Rowe


Oct 1 '07 #4

P: n/a
"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:83**********************************@microsof t.com...
2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and
not
running a batch where @ applies.
All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

....

Maybe an argument??

Thanks


Oct 1 '07 #5

P: n/a
I believe you would need to change the environment variable for the PROMPT,
then use that environment for the process.start. I don't think a command
argument for cmd.exe exists for this.

"Academia" wrote:
"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:83**********************************@microsof t.com...
2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and
not
running a batch where @ applies.

All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

....

Maybe an argument??

Thanks


Oct 1 '07 #6

P: n/a
On Oct 1, 9:41 am, "Academia" <academiaNOS...@a-znet.comwrote:
"Family Tree Mike" <FamilyTreeM...@discussions.microsoft.comwrote in
messagenews:83**********************************@m icrosoft.com...
2. @ is a batch symbol which only applies to batch files, or interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect), and
not
running a batch where @ applies.

All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

...

Maybe an argument??

Thanks
How about this:

///////////////////////
'// Thanks to Wikipedia for giving me this
'// simple batch file

Dim filePath As String = "C:\MyFile.bat"

Using sw As New StreamWriter(filePath, False)
sw.WriteLine("@echo off")
sw.WriteLine("echo Hello, World!")
sw.WriteLine("pause nul")
End Using

Dim p As Process = Process.Start(filePath)

p.WaitForExit(2500)

File.Delete(filePath)
//////////////////////

Thanks,

Seth Rowe

Oct 1 '07 #7

P: n/a
Thanks, I'll try that
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Oct 1, 9:41 am, "Academia" <academiaNOS...@a-znet.comwrote:
>"Family Tree Mike" <FamilyTreeM...@discussions.microsoft.comwrote in
messagenews:83**********************************@ microsoft.com...
2. @ is a batch symbol which only applies to batch files, or
interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect),
and
not
running a batch where @ applies.

All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

...

Maybe an argument??

Thanks

How about this:

///////////////////////
'// Thanks to Wikipedia for giving me this
'// simple batch file

Dim filePath As String = "C:\MyFile.bat"

Using sw As New StreamWriter(filePath, False)
sw.WriteLine("@echo off")
sw.WriteLine("echo Hello, World!")
sw.WriteLine("pause nul")
End Using

Dim p As Process = Process.Start(filePath)

p.WaitForExit(2500)

File.Delete(filePath)
//////////////////////

Thanks,

Seth Rowe

Oct 1 '07 #8

P: n/a
thanks for the help

"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:04**********************************@microsof t.com...
>I believe you would need to change the environment variable for the PROMPT,
then use that environment for the process.start. I don't think a command
argument for cmd.exe exists for this.

"Academia" wrote:
>"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:83**********************************@microsof t.com...
2. @ is a batch symbol which only applies to batch files, or
interactive
cmd.exe. Your process is running cmd.exe with commands (I suspect),
and
not
running a batch where @ applies.

All I want to do is change the prompt without echo.
Is there some way (without using a batch file) that I could effectively
do.
sMyProcess.StartInfo = StartInfo

sMyProcess.Start()

Dim SWIn As System.IO.StreamWriter = sMyProcess.StandardInput

SWIn.WriteLine("@prompt $G")

....

Maybe an argument??

Thanks



Oct 1 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.