Search found 46 matches

by CirothUngol
11 Sep 2018 10:02
Forum: DOS Batch Forum
Topic: Find recursively (!) all empty dirs below top folder?
Replies: 3
Views: 1829

Re: Find recursively (!) all empty dirs below top folder?

Well, if removing empty directories is what you're after as opposed to Simply locating them, then the following macro does that rather efficiently. ::recursively remove all empty folders from a directory tree SET nullDir=FOR %%# IN (1 2)DO IF %%#==2 (%\n% FOR /F "tokens=*" %%: IN ('DIR /AD-S/B/S !##...
by CirothUngol
03 Sep 2018 13:33
Forum: DOS Batch Forum
Topic: consolesoft.com is closing
Replies: 13
Views: 4755

Re: consolesoft.com is closing

Hiya Carlos!
Thanks for providing archives for your projects, and thanks for bg.exe! v3.0a is still my go-to for simple, quick, all-in-one control of console display and keyboard input. Hopefully fscreen.exe (fullscreen) is in there somewhere, I think that one's really neat!
by CirothUngol
25 Aug 2018 16:25
Forum: DOS Batch Forum
Topic: Color Function 21 22 23c
Replies: 37
Views: 24838

Re: Color Function 21 22 23c

Cool little color routine! I'm still picking apart v23c, super neat how it works. I'm looking to divorce my latest project from it's dependence on auxiliary programs before posting it and was wondering if this would still be considered the best method of displaying color text to the console using na...
by CirothUngol
21 Aug 2018 17:41
Forum: DOS Batch Forum
Topic: What does & mean?
Replies: 7
Views: 1875

Re: What does & mean?

Wait, isn't there also... && = execute following command only if previous command's errorlevel==0 || = execute following command only if previous command' errorlevel<>0 So... someCommand && doIfErrLev==0 || doIfErrLev<>0 ...is analogous to: someCommand if errorlevel 1 (doIfErrLev<>0) ELSE (doIfErrLe...
by CirothUngol
18 Aug 2018 13:48
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% v0.2 - a full-featured WinNT math macro

I was scanning the final v0.2 macro and cleaning up the various versions I went through over the last couple of months (about 12) and think that, other than any corrections for discovered errors, %MM% is done. It might be possible to squeeze out a few dozen more characters, but what else is there? T...
by CirothUngol
18 Aug 2018 12:48
Forum: DOS Batch Forum
Topic: Small Macros - timeSince, nullDir, prt, poz
Replies: 6
Views: 1981

Re: Small Macros - timeSince, nullDir, prt, poz

...not the only other possibilities that exist. Consider to use the output of wmic os get localdatetime /value Neat! I've never used WMIC. When did it appear, WinXP and up? Is the output standard on all windows versions? It required elevated permissions on my machine to operate, how does one do thi...
by CirothUngol
18 Aug 2018 01:05
Forum: DOS Batch Forum
Topic: Small Macros - timeSince, nullDir, prt, poz
Replies: 6
Views: 1981

Small Macros - timeSince, nullDir, prt, poz

@ECHO OFF :: define a newline with line continuation (SET \n=^^^ %= This defines an escaped Line Feed - DO NOT ALTER =% ) :: echo text to the console without CR/LF SET "eko=<NUL SET/P=" :: print everything but % without DelayedExpansion SET "prt=@FOR /F %%^" in ("""")DO @ECHO(%%~"" %PRT%Print &,|,<...
by CirothUngol
17 Aug 2018 18:04
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% v0.2 - a full-featured WinNT math macro

I've updated the OP with MM v0.2, I was able to add logical, unary, and bitwise operations. The bitwise ops are all passed directly to SET/A, which treats values above 2147483647 as 2147483647 and below -2147483648 as -2147483648 (because they're contained in variables?). I've reduced most of the va...
by CirothUngol
15 Aug 2018 17:57
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

Thanks for the compliments! ^_^ Yup, that should work just fine. Only the 'SET \n=' and the 'SET MM=' definitions are required, the macro is otherwise completely self-contained. You could also just copy/paste it into your batchfile removing the need for multiple batch scripts. The interactive bit is...
by CirothUngol
10 Aug 2018 16:34
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

:shock: That doesn't look right :? It looks like you initialize the return value to 0 with SET dc=0, and then conditionally set the return value to 1, but using n0 instead of dc. What am I missing :?: It would probably help if I bothered to delineate exactly what each variable is, I should actually...
by CirothUngol
10 Aug 2018 07:10
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

As I thought about it, ^ seemed like it would only be a real issue if the user decided to expand variables with ! instead of just passing them in (for some reason), but I like the idea of just doubling || as it's already being parsed and is more easily managed. It took some searching to find the mea...
by CirothUngol
09 Aug 2018 21:01
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

Actually I was thinking of true logical operators that always produce 0 or 1, not bit operators. The logical operators would be really useful for the ternaryIf operator. You could implement bit operators... But I don't really see the point... Me neither, really. My enthusiasm for doing it would be ...
by CirothUngol
09 Aug 2018 15:45
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

Again, thanks for the interest DB and for the suggestions. Let's see... One thing you need to do is document all of the internal variables that are at risk of conflicting with user defined variables. The macro uses nested SETLOCALs. The first captures the user's environment and only variables beginn...
by CirothUngol
09 Aug 2018 00:55
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

Re: %MM% - a full-featured WinNT math macro

Wow, thanks Dave! I should have looked before posting my update, but I'll post another later after I incorporate your alterations. I remember hitting that loop when writing Math.cmd, but it disappeared when I added decimal-rounding to the script. I just read about the improved %\n% today, thanks for...
by CirothUngol
08 Aug 2018 06:54
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 6323

%MM% v0.2a - a full-featured WinNT math macro

Hiya guys! Been awhile since I dropped by, but I just wanted to share my latest little goodie... and hopefully find a few interested testers. ^_^ %MM% is a math macro that contains all of the functionality of my previous large, slow, and over-bloated Math.cmd utility, except for functions and decima...