Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Questions about ProcessStartInfo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Academia - 01 Oct 2007 01:36 GMT
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
Family Tree Mike - 01 Oct 2007 03:34 GMT
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.

> I use:
>
[quoted text clipped - 20 lines]
>
> Thanks for any help
rowe_newsgroups - 01 Oct 2007 11:28 GMT
> 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
Academia - 01 Oct 2007 14:42 GMT
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

>> 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
[quoted text clipped - 9 lines]
>
> Seth Rowe
Academia - 01 Oct 2007 14:41 GMT
> 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
Family Tree Mike - 01 Oct 2007 15:53 GMT
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.

> > 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
[quoted text clipped - 17 lines]
>
> Thanks
Academia - 01 Oct 2007 21:31 GMT
thanks for the help

>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
[quoted text clipped - 23 lines]
>>
>> Thanks
rowe_newsgroups - 01 Oct 2007 16:52 GMT
> > 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
[quoted text clipped - 17 lines]
>
> 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
Academia - 01 Oct 2007 21:32 GMT
Thanks, I'll try that

>> > 2. @ is a batch symbol which only applies to batch files, or
>> > interactive
[quoted text clipped - 44 lines]
>
> Seth Rowe

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.