Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# Process UseShellExecute query

C# Process UseShellExecute query

Scheduled Pinned Locked Moved C#
csharpdatabaselinuxquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kuira
    wrote on last edited by
    #1

    I got a simple HelloWorld.Exe that prints out helloworld And I got another application that wants to process that exe file, store as a string and the reprint hello world, called "ReadHelloWorld.exe" But I find that use the property from Process "UseShellExecute" when turned false, is that the Working directory I set to wont be used, so I can only execute HelloWorld.exe within ReadHelloWorld.exe. Is there a way such that I can use the Process to store it as a string without resorting to using a shell to execute the command, store it as a text file, read its contents then removing the temporary text file? Kuira

    X 1 Reply Last reply
    0
    • K Kuira

      I got a simple HelloWorld.Exe that prints out helloworld And I got another application that wants to process that exe file, store as a string and the reprint hello world, called "ReadHelloWorld.exe" But I find that use the property from Process "UseShellExecute" when turned false, is that the Working directory I set to wont be used, so I can only execute HelloWorld.exe within ReadHelloWorld.exe. Is there a way such that I can use the Process to store it as a string without resorting to using a shell to execute the command, store it as a text file, read its contents then removing the temporary text file? Kuira

      X Offline
      X Offline
      Xiangyang Liu
      wrote on last edited by
      #2

      Kuira wrote:

      Is there a way such that I can use the Process to store it as a string without resorting to using a shell to execute the command, store it as a text file, read its contents then removing the temporary text file?

      Yes. Basically you need how to learn to redirect the standard output. The following article and code will do exactly what you want and more: Run other programs from your .NET code[^] Hope it helps.[

      My articles and software tools

      ](http://mysite.verizon.net/XiangYangL/index.htm)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups