Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4325498
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:16:29+00:00 2026-05-21T09:16:29+00:00

I need a very simple program to run on any version of Windows, let’s

  • 0

I need a very simple program to run on any version of Windows, let’s say >= Win 98, without requiring any pre-installed framework like dotnet. I thought C would be a great idea to do this.

The program should start a process from the parent directory by using a system command.

Start C program (invisible) > program starts process > program exits

This is how it looks:

#include <stdio.h>
#include <stdlib.h>

int main() {
    system("..\\someprogram.exe");
    return 0;
}

I call this program from a Flash projector, which only allows to start programs in a specific subfolder “fscommand” – but I have to start a process located in the same directory as the projector.

Anyway, it works fine! But the C program opens a command box, then starts the process and leaves the command box open as long as the process runs. So here is how it should work, in order how i would appreciate it:

  1. Do not open a command box at all (I’d like that, really 😉
  2. Both 3) and 4)
  3. Close the command box after starting the process (exit the C program)
  4. Open the command box minimized by default

I can’t change any Windows settings for the C executable or use a shortcut, as this will run directly from a CD later.

I use Open Watcom to compile my program. Both image types (target options) that produce an executable (Character-mode Executable / Windowed Executable) have the same result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:16:30+00:00Added an answer on May 21, 2026 at 9:16 am

    I did a google search and found http://www.ntwind.com/software/utilities/hstart.html

    Your using a console app, you could change it to a windows app using winmain()

    You can use a shortcut to a file in the same folder, not sure why your discounting that method.

    start will give you a fork so your intermediate app can close – not sure about win98 tho.

    system("start ..\\someprogram.exe");
    

    Instead of system you can use createProcess to launch the app, theis will avoid the system commands console.

    STARTUPINFO si;
    PROCESS_INFORMATION pi;
    
    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );
    
    // Start the child process. 
    if( !CreateProcess( "..\\someprogram.exe",   // module name 
        NULL,        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi )           // Pointer to PROCESS_INFORMATION structure
    ) 
    {
        printf( "CreateProcess failed (%d).\n", GetLastError() );
        return;
    }
    
    // Wait until child process exits.  In your case you don't care to wait anyway
    // WaitForSingleObject( pi.hProcess, INFINITE );
    
    // Close process and thread handles. 
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As part of a very simple cmd.exe install script, I need to run a
I need a very simple and clear example of how to create an OCX
I need to be able to merge two (very simple) JavaScript objects at runtime.
I need to do a few very simple URL manipulations in Java. Like get
i have very simple problem. I need to create model, that represent element of
I need a very accurate way to time parts of my program. I could
Say I need some very special multiplication operator. It may be implemented in following
I used to program in Windows with Microsoft Visual C++ and I need to
Summary When I execute a very simple program using Perl's Benchmark utility. I get
I need a very quick fix in a mod_rewrite expression for drupal we have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.