473,320 Members | 2,012 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,320 software developers and data experts.

Questions about ProcessStartInfo

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
8 1757
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
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

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
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stedak | last post by:
My application seems to freeze when Microsoft Office Document Imaging is set as the default for loading images. If the Windows Picture and Fax Viewer is used there is no problem. When I set a break...
0
by: Matt | last post by:
I am running a exe from command line in my application and when I use ProcessStartInfo it seems to duplicate all the commands within the function. for instance I write a file. Without my...
1
by: nospam | last post by:
Hi, Can you let me know why this won't display the standard output on console? Thanks Process myProcess = new Process();
8
by: lurker | last post by:
If a compiled exe project is under 400kb, why does it take up 15Mb when running? Is this normal? If not, how do I restrict the amount of memory it can consume? Secondly, does anyone have a bit...
2
by: Eranga | last post by:
I have a windows application in C# which has the following method public void InitiateSession(string server,string userName, string passWd ) { //To start the command...
0
by: MadCrazyNewbie | last post by:
Hi Group, I have the following code, but not sure if this is write, I would like to be able with the View code, for the document to be opened eg. C:\test.Doc and with the PRint button for it to...
1
by: Philip Wagenaar | last post by:
How do I set the string "myPass" for ProcessStartInfo.Password? Dim instance As ProcessStartInfo instance.Password "myPass" 'This is no good because its System.Security.String instance.UserName...
1
by: Vinny Vinn | last post by:
I am using the following C# code to print a PDF to a network printer. The document prints in portrait mode, I would like the document to print in Landscape mode. Is there/What is the argument that...
2
by: =?Utf-8?B?TWljaGVsbGUgTWFiZWxsZQ==?= | last post by:
I have the code below. It will open and print the pdf file (test.pdf) to the printer. ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = true; startInfo.Verb =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.