Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Strang MS-DOS Batch Problem - Help?

Author
Message
Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 28th Jan 2009 01:59
I know this isn't exactly the specialty of the people of this forum, but I figured someone would know what to do. You see, I'm trying to get my "OS" to compile properly through the use of .BAT files. Now, I'm having a problem actually getting the batch file (makedir.bat) to work. What it's supposed to do is compile the contents of an entire directory (checking the file types for .c or .asm), and then adding the outputs of those files to a list to be linked together. The whole environment for this is attached, if anyone would mind helping me. The problem is inside of a FOR loop in the batch file.

Cheers,

-naota

I'm not a dictator to those that do stuff for me by will. Only those who don't.

Attachments

Login to view attachments
mr_d
DBPro Tool Maker
18
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 28th Jan 2009 09:20
Hi Aaron,
You didn't specify which FOR loop you were having problems with, and didn't specify what the problem was either, so I had to make assumptions and run it as I thought it would run...


Anyway, I think I found your main problem; and that was that you missed the all important SET command to initialise the Command Extensions (assuming these are actually available to you).

i.e. after your "@echo off" command at the top, you should have the following line:

setlocal enabledelayedexpansion

also, I did a little cleanup and reformatting of your code for the last bit, and here is the (hopefully) working section:



should work as expected, or at least point you in the right direction. cheers.
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 29th Jan 2009 20:23
Why not use make or a similar tool?

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.
Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 29th Jan 2009 22:51
@mr_d
Oh, thank you. I suppose enabled that would help then, eh? lol.

@the_winch
Because I don't like make. I'll probably end up making my own tool, but I just don't like make, I prefer BATCH. The syntax is, cleaner so to speak.

Cheers,

-naota

I'm not a dictator to those that do stuff for me by will. Only those who don't.

Login to post a reply

Server time is: 2025-06-07 20:41:00
Your offset time is: 2025-06-07 20:41:00