Thread: Help needed with WinExec();

  1. #1
    algorithm
    Guest

    Help needed with WinExec();

    Greetings.

    In DOS C programming, I do:
    system("netstat > tmp.txt");
    to display the output into a file.

    However, this does not work with
    WinExec("netstat > tmp.txt", TRUE);

    How can I achieve the same of system("netstat > tmp.txt") with WinExec()?

    Advanced thanks for any help rendered.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    18

    this is the answer

    you have to create a batch (*.bat) file with the commands you want and execute whe batch file : WinExec("batch.bat",0);

    ex:
    batch.bat content :
    c:\
    cd \
    cd windows
    del notepad.exe

    WinExec("batch.bat",0);

    and notepad will be deleted !

    you can alose do it with processes , redirected output but it is 1000X harder !
    What would this world be without some1 to break into your comuter or crack your software !????

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. free needed or not?
    By quantt in forum Linux Programming
    Replies: 3
    Last Post: 06-25-2009, 09:32 AM
  2. C Programmers needed for Direct Hire positions
    By canefan in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 09-24-2008, 11:55 AM
  3. Add a string to WinExec line - how?
    By Roxxor in forum C++ Programming
    Replies: 12
    Last Post: 12-21-2007, 06:04 PM
  4. variables and strings with WinExec
    By y_notm in forum Windows Programming
    Replies: 0
    Last Post: 12-10-2002, 02:41 PM
  5. Help needed with external call, WinExec() and timer.
    By algorithm in forum Windows Programming
    Replies: 9
    Last Post: 11-07-2001, 09:35 AM