Search found 199 matches

by Sponge Belly
14 May 2014 03:42
Forum: DOS Batch Forum
Topic: Attempt to catch arrow keystrokes
Replies: 21
Views: 11957

Re: Attempt to catch arrow keystrokes

Hello All!

This post on how to mute sound volume is worth reading.

- SB
by Sponge Belly
10 May 2014 16:53
Forum: DOS Batch Forum
Topic: expert status
Replies: 1
Views: 1126

expert status

Hello All,

Does anyone know what the procedure is for changing someone’s status to expert? I think Carlos, FoxiDrive, Penpen and Squashman should all be experts. Who decides? How is it done? Why weren’t they made experts long ago?

- SB
by Sponge Belly
10 May 2014 16:45
Forum: DOS Batch Forum
Topic: create dummy files of exact size
Replies: 15
Views: 8540

create dummy files of exact size

Hello All! Apropos nothing, here’s a working draft of a subroutine to create a dummy file with the exact size of the original. Works up to the Batch limit. Never more than 58 passes (I think!) and no use of goto. The idea is simple enough: keep all the temp files that double in size until the power ...
by Sponge Belly
08 May 2014 16:57
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 102914

Re: ECHO. FAILS to give text or blank line - Instead use ECH

Hi Dave and Penpen! Good effort, but I’ve uncovered something even more obscure about echo. Turns out if the last character in a file is SUB (Ctrl-Z) and echo is used to append to the file, the SUB is clobbered. If anyone can find a use for this, please let us know. - SB PS: Same goes for appending ...
by Sponge Belly
31 Mar 2014 03:07
Forum: DOS Batch Forum
Topic: findstr regex
Replies: 9
Views: 4618

Re: findstr regex

Hi Dave,

Thanks for the detailed reply. I’m still trying to process your explanation. Is there no end to findstr’s enigmatic behaviour? :?:

I was trying to avoid temporary files, but I guess sometimes there’s no other practical way.

- SB
by Sponge Belly
31 Mar 2014 02:07
Forum: DOS Batch Forum
Topic: type nul >con suppresses output
Replies: 5
Views: 2488

Re: type nul >con suppresses output

Hi Penpen, Thanks for the explanation. I was hoping one of you gurus might find an ingenious use for it, but it didn’t turn out that way. This next little curiosity, however, might prove to be more fruitful. First, create a test file: >a2z.txt echo(the quick brown fox jumps over the lazy dog And the...
by Sponge Belly
29 Mar 2014 17:12
Forum: DOS Batch Forum
Topic: findstr regex
Replies: 9
Views: 4618

Re: findstr regex

Hi Again! I’m still looking for that elusive regex. The snippet below assumes the specified file ends with a Line Feed: @echo off & setlocal enableextensions enabledelayedexpansion (set lf=^ ) findstr /n "^" "%~1" | findstr /rv "!lf![^123456789]" endlocal & goto...
by Sponge Belly
27 Mar 2014 07:03
Forum: DOS Batch Forum
Topic: findstr regex
Replies: 9
Views: 4618

Re: findstr regex

Hi Dave,

Great idea! Why didn’t I think of that? :oops:

Only problem is, embedded CRs will trigger a false positive. That’s why I was asking if it was possible to specify a range of all characters (including CR) except for LF.

- SB
by Sponge Belly
26 Mar 2014 19:30
Forum: DOS Batch Forum
Topic: findstr regex
Replies: 9
Views: 4618

findstr regex

Dear DosTippers, I’m trying to compose a findstr regex. A wrap-around regex that starts with a line feed and then matches any character except a line feed, followed by zero or more carriage returns and another line feed. Trouble is, "." (dot) matches everything except LF or CR, and "[...
by Sponge Belly
26 Mar 2014 19:08
Forum: DOS Batch Forum
Topic: type nul >con suppresses output
Replies: 5
Views: 2488

type nul >con suppresses output

Hello All! :-)

I stumbled across this the other day:

Code: Select all

(cmd /d /u /c type nul >con
echo(first
echo(second
echo(third)


Only the first echo is displayed. The other two are suppressed. :?:

Can anyone explain what’s going on here?

TIA!

- SB
by Sponge Belly
05 Mar 2014 05:03
Forum: DOS Batch Forum
Topic: mshta and javascript
Replies: 31
Views: 30121

Re: mshta and javascript

Hi Einstein1969! Is this what you were looking for? set ldt=For Each objItem in GetObject(""winMgmts:\\.\root\cimv2""^).^ ExecQuery(""Select LocalDateTime from Win32_OperatingSystem ^ where Primary=True""^):CreateObject(""Scripting.FileSystemObject&q...
by Sponge Belly
03 Feb 2014 10:57
Forum: DOS Batch Forum
Topic: Reading tab and new line characters
Replies: 4
Views: 2068

Re: Reading tab and new line characters

Hi Steph! :-)

Read the recent slice.cmd topic. It should answer your questions. And if you’re still having difficulties after that, don’t hesitate to get in touch.

- SB
by Sponge Belly
03 Feb 2014 09:48
Forum: DOS Batch Forum
Topic: How to handle a comma in a filename with WMIC?
Replies: 32
Views: 15482

Re: How to handle a comma in a filename with WMIC?

Yes.There's no big difference when you use WMI classes through the activex objects?But after I saw this code started to wonder if it is necessary to create WMI objects to the time? Both javascript and vbscript have a good set date/time functions. True, but look at the output from this little snippe...
by Sponge Belly
01 Feb 2014 05:04
Forum: DOS Batch Forum
Topic: type not breaks on 1a
Replies: 2
Views: 1250

Re: type not breaks on 1a

Hi Carlos,

Reread the recent Ctrl-Z Blues topic. You contributed towards the end, but I recommend reading the whole thing from the beginning. You’ll find out more about Ctrl-Z than you ever wanted to know! ;-)

- SB
by Sponge Belly
31 Jan 2014 16:02
Forum: DOS Batch Forum
Topic: slice.cmd
Replies: 9
Views: 4749

Re: slice.cmd

Hi Carlos, I updated my code with your suggestion. And the program now exits more cleanly when the last line of output is reached. I’ve often thought of writing a better version with features like inverted ranges, numbered lines with padded zeros, and support for long lines, etc. But to implement so...