Questions about ProcessStartInfo

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Academia

    #1

    Questions about ProcessStartInfo

    I use:

    'Execute Command (DOS) commands

    Dim StartInfo As New ProcessStartInf o

    Static sMyProcess As New Process

    StartInfo.FileN ame = "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






  • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

    #2
    RE: Questions about ProcessStartInf o

    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 ProcessStartInf o
    >
    Static sMyProcess As New Process
    >
    StartInfo.FileN ame = "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
    >
    >
    >
    >
    >
    >
    >

    Comment

    • rowe_newsgroups

      #3
      Re: Questions about ProcessStartInf o

      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


      Comment

      • Academia

        #4
        Re: Questions about ProcessStartInf o


        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.Star tInfo = StartInfo

        sMyProcess.Star t()

        Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput

        SWIn.WriteLine( "@prompt $G")

        ....

        Maybe an argument??

        Thanks


        "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
        news:1191234512 .235711.202240@ g4g2000hsf.goog legroups.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
        >
        >

        Comment

        • Academia

          #5
          Re: Questions about ProcessStartInf o

          "Family Tree Mike" <FamilyTreeMike @discussions.mi crosoft.comwrot e in
          message news:83A1D868-B773-4BB8-A6B8-4D5F553257A0@mi crosoft.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.Star tInfo = StartInfo

          sMyProcess.Star t()

          Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput

          SWIn.WriteLine( "@prompt $G")

          ....

          Maybe an argument??

          Thanks




          Comment

          • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

            #6
            Re: Questions about ProcessStartInf o

            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" <FamilyTreeMike @discussions.mi crosoft.comwrot e in
            message news:83A1D868-B773-4BB8-A6B8-4D5F553257A0@mi crosoft.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.Star tInfo = StartInfo
            >
            sMyProcess.Star t()
            >
            Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput
            >
            SWIn.WriteLine( "@prompt $G")
            >
            ....
            >
            Maybe an argument??
            >
            Thanks
            >
            >
            >
            >
            >

            Comment

            • rowe_newsgroups

              #7
              Re: Questions about ProcessStartInf o

              On Oct 1, 9:41 am, "Academia" <academiaNOS... @a-znet.comwrote:
              "Family Tree Mike" <FamilyTreeM... @discussions.mi crosoft.comwrot e in
              messagenews:83A 1D868-B773-4BB8-A6B8-4D5F553257A0@mi crosoft.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.Star tInfo = StartInfo
              >
              sMyProcess.Star t()
              >
              Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput
              >
              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(fi lePath, False)
              sw.WriteLine("@ echo off")
              sw.WriteLine("e cho Hello, World!")
              sw.WriteLine("p ause nul")
              End Using

              Dim p As Process = Process.Start(f ilePath)

              p.WaitForExit(2 500)

              File.Delete(fil ePath)
              //////////////////////

              Thanks,

              Seth Rowe

              Comment

              • Academia

                #8
                Re: Questions about ProcessStartInf o

                Thanks, I'll try that
                "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
                news:1191253956 .005440.299440@ k79g2000hse.goo glegroups.com.. .
                On Oct 1, 9:41 am, "Academia" <academiaNOS... @a-znet.comwrote:
                >"Family Tree Mike" <FamilyTreeM... @discussions.mi crosoft.comwrot e in
                >messagenews:83 A1D868-B773-4BB8-A6B8-4D5F553257A0@mi crosoft.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.Sta rtInfo = StartInfo
                >>
                >sMyProcess.Sta rt()
                >>
                >Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput
                >>
                >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(fi lePath, False)
                sw.WriteLine("@ echo off")
                sw.WriteLine("e cho Hello, World!")
                sw.WriteLine("p ause nul")
                End Using
                >
                Dim p As Process = Process.Start(f ilePath)
                >
                p.WaitForExit(2 500)
                >
                File.Delete(fil ePath)
                //////////////////////
                >
                Thanks,
                >
                Seth Rowe
                >

                Comment

                • Academia

                  #9
                  Re: Questions about ProcessStartInf o

                  thanks for the help

                  "Family Tree Mike" <FamilyTreeMike @discussions.mi crosoft.comwrot e in
                  message news:04057CC5-6606-447F-81C1-0DA9813FD1E2@mi crosoft.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" <FamilyTreeMike @discussions.mi crosoft.comwrot e in
                  >message news:83A1D868-B773-4BB8-A6B8-4D5F553257A0@mi crosoft.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.Sta rtInfo = StartInfo
                  >>
                  >sMyProcess.Sta rt()
                  >>
                  >Dim SWIn As System.IO.Strea mWriter = sMyProcess.Stan dardInput
                  >>
                  >SWIn.WriteLine ("@prompt $G")
                  >>
                  >....
                  >>
                  >Maybe an argument??
                  >>
                  >Thanks
                  >>
                  >>
                  >>
                  >>
                  >>

                  Comment

                  Working...