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

  • SEARCH
  • Home
  • 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 8254529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:13:20+00:00 2026-06-08T01:13:20+00:00

In a .bat file I’m executing a compiler with the line cl -GL -Od

  • 0

In a .bat file I’m executing a compiler with the line

cl -GL -Od -Zi <all .h files> <all .c files>

but I don’t know how to reference all .c and .h files in that manner. I was thinking */.c and */.h, but both of those are invalid arguments. Is there any way I could reference all .c and .h files in this manner?

  • 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-06-08T01:13:22+00:00Added an answer on June 8, 2026 at 1:13 am

    cl doesn’t let you do this, but if you want to compile all C files in every folder starting from a certain point, then you can do something like the following.

    Note, with those command options you can’t pass in a header file either.

    
    @echo off
    set USAGE=Usage: %~n0 "C:\Existent Start Dir"
    if %1xx == xx ( echo %USAGE% & exit /b 2 )
    if not exist "%~1" ( echo %USAGE% & exit /b 1 )
    for /r "%~dpn1" %%f in (.) do (
      pushd %%f
      if exist *.c (
        echo *** Compiling C files in %%f ***
        call cl -GL -Od -Zi *.c
        echo.
      )
      popd
    )
    

    Test this with:
    test.cmd C:\mytest

    If C:\mytest contains several folders of simple *.c and *.h files this will work.
    test.cmd C:\mytest

    You might really be wanting to invoke nmake?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .bat file that publishes my VS2010 application, then copies the files
I have created a .bat file that displays all the users logged in Windows
Possible Duplicate: how to write bat file to process all files include sub directory,
I've a task(.bat file) which should be performed/executed after every 15mins. I don't know
I have a bat file that I want to run at specific day/time in
I have a .bat file to be executed. Inside that .bat file, at its
In my .bat file I want to generate a unique name for files/directories based
I have bat-file, that make some operations. How to run this file from Delphi
ive written a quick .bat file that reads in the name of a directory
when i run a .BAT file, it displays a message but immediately closes the

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.