Set execution path for spawnle

This is a discussion on Set execution path for spawnle within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, hit some error here, please help. I had tried to spawn the exe using spawnl(_P_NOWAIT, "test folder\testing.exe", NULL), ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    58

    Set execution path for spawnle

    Hi everyone,
    hit some error here, please help. I had tried to spawn the exe using
    spawnl(_P_NOWAIT, "test folder\testing.exe", NULL), but it doesn''t work as I expected. I believe that it must have something to do with the current working directory stuff. Therefore I tried to use the code below. But somehow still cannot, any idea?

    Code:
    int value;
    char *env_list[] = {"path=C:\\Testing\\Release\test folder",NULL};
    
    value = _spawnle( _P_NOWAIT, "test folder\\testing.exe",env_list[0], NULL, env_list);

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    you could use the Win32 ShellExecute() command. I don't know the exact parameters for it, but search MSDN and it is easy to use. That is if your only programming for the windows platform.

  3. #3
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    Code:
    ...\\Release\test folder",NULL};
    should maybe be
    Code:
    ...\\Release\\test folder",NULL};
    With 2 \'s before test folder
    Don't quote me on that... ...seriously

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Execution Time - Rijandael encryption
    By gamer4life687 in forum C++ Programming
    Replies: 5
    Last Post: 09-20-2008, 10:25 PM
  2. clipping path
    By stanlvw in forum Windows Programming
    Replies: 0
    Last Post: 07-24-2008, 12:47 AM
  3. optimising program
    By SONU in forum C Programming
    Replies: 1
    Last Post: 05-18-2008, 11:28 AM
  4. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM

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