Results 1 to 10 of 10

Thread: How to set PATH?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Posts
    130

    How to set PATH?

    Good day everybody,

    Just one simple question.
    How do I set PATH in VC++?
    This PATH is the path that, if we are to use in MS-DOS, it's set this way, 'SET PATH = C:\Windows".

    Thanks in advanced.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    setenv from stdlib.h should work.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Posts
    130
    I'll try it. Thanks.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Note that that won't affect any other programs. The environment you change applies to that program only.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That's right, but that may depend on the system (not sure if DOS seperated program environments).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Would using system modify the variables globally?

    Z.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by Zaei
    Would using system modify the variables globally?

    Z.
    No, it would modify it in the environment created by the call to system().

    Vicious, isn't it
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    I know! Write a .bat file to the hard drive, and then run it with system()!

    Geez, I sound like some n00b H4X0R =).

    Z.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Wouldn't work either, as the batch file would then again run in the environment created by system.

    But you can write a batch file and run it with ShellExecute.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Hmmm... I know! I will write a batch file to the start menu, and then... take a screen shot, search through it until I find the start menu. If not found, move the mosue to the bottom of the screen, using SetCursorPos. Then, search again. Make Mouse click on Start Button, and find the batch file, again, using a screen shot. Click on the batch file!

    I R L33T HAXOR!

    Z.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width