Passing Envoronment Variables to Executables

This is a discussion on Passing Envoronment Variables to Executables within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I need to pass some Envoronment Variables to a file (to be used to CGI scripts). I also ...

  1. #1
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986

    Passing Envoronment Variables to Executables

    Hello everyone,

    I need to pass some Envoronment Variables to a file (to be used to CGI scripts). I also need to run that executable and pipe all the output to my program and into a buffer.

    I have been using _popen() to get the input to my program and its all been working fine, now the only difference is I need to supply that environment variable.

    What functions should I look up that can do this? Can I still use _popen() and simply add a line to it before calling? Any help would be greatly appreciated.

    ~ Paul

    PS: This is what I have tried:

    set QUERY_STRING "?user=john"
    PHP.exe H:\paul.php

    But that doesn't work, somehow I need to tell PHP.exe theres an envoronment variable for it.

  2. #2
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    No sorry, thats to get the env. variable. What I need is to SET the environment variable to the value I desire.

    Any ideas?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems passing values from function to main variables
    By ERJuanca in forum C Programming
    Replies: 18
    Last Post: 06-12-2009, 08:13 PM
  2. Passing variables to a subroutine
    By shaig in forum C Programming
    Replies: 5
    Last Post: 03-16-2009, 07:21 PM
  3. C# in ASP.Net - Passing complex variables
    By Llam4 in forum C# Programming
    Replies: 3
    Last Post: 01-19-2008, 02:53 AM
  4. passing variables between functions
    By owi_just in forum C Programming
    Replies: 6
    Last Post: 05-08-2005, 10:12 AM
  5. passing variables
    By Leeman_s in forum C++ Programming
    Replies: 3
    Last Post: 10-04-2001, 03:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21