Search found 195 matches

by Sponge Belly
28 Dec 2016 09:24
Forum: DOS Batch Forum
Topic: line numbers in find vs findstr
Replies: 10
Views: 3048

Re: line numbers in find vs findstr

Hi Spodermon! Happy Christmas and welcome to the forum. Paste the following (untested) code into an empty Notepad window and save the file as lineNo.cmd: @echo off & setlocal enableextensions disabledelayedexpansion for /f "delims=:" %%A in (' findstr /bilnc:"portshow 0" &quo...
by Sponge Belly
10 Nov 2016 04:29
Forum: DOS Batch Forum
Topic: Resetting multiple variables at once
Replies: 4
Views: 1418

Re: Resetting multiple variables at once

Hello All! :)

Check out this technique developed by Aacini.

- SB
by Sponge Belly
07 Nov 2016 13:47
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 26
Views: 9194

Re: Foxidrive has left us

Hello All, I am shocked and saddened to hear of FoxiDrive’s untimely death. He tirelessly and selflessly devoted his free time to helping others. He leaves behind an enduring legacy in the form of thousands of patient and thoughtful answers to programming questions asked on forums and newsgroups fro...
by Sponge Belly
06 Sep 2016 04:19
Forum: DOS Batch Forum
Topic: ExitCode in JScript != ErrorLevel in Batch
Replies: 4
Views: 1686

Re: ExitCode in JScript != ErrorLevel in Batch

Hi Steffen! Thanks for your helpful answer… and not pointing out the glaring error in my definition of inFile2 (now corrected). It didn’t occur to me that Exec runs commands asynchronously and that I had to wait for fc to finish. I did read the documentation, I just didn’t absorb it. Maybe it’s time...
by Sponge Belly
05 Sep 2016 14:18
Forum: DOS Batch Forum
Topic: ExitCode in JScript != ErrorLevel in Batch
Replies: 4
Views: 1686

ExitCode in JScript != ErrorLevel in Batch

Hello All! I wanted to compare 2 files using JScript to see if they were the same or not. I thought the Exec method’s ExitCode property would return 0 for yes, and 1 for no. But it always returns 0: @if (@X==@Y) @then @echo off & setlocal enableextensions disabledelayedexpansion cscript //nologo...
by Sponge Belly
05 Sep 2016 10:39
Forum: DOS Batch Forum
Topic: Regsrv32 exploit
Replies: 11
Views: 4709

Re: Regsrv32 exploit

Hi Foxi, Thanks for your helpful suggestion and sorry for not replying sooner. I’ve been wracking my brains over this and I haven’t been able to come up with a practical solution. Ideally, I want to write robust code that will work on all versions of Windows and won’t be tripped up by gotchas like c...
by Sponge Belly
28 Aug 2016 03:03
Forum: DOS Batch Forum
Topic: How to rename files like 00080.jpg to 01080.jpg?
Replies: 11
Views: 2230

Re: How to rename files like 00080.jpg to 01080.jpg?

Hi Doscode! :)

Maybe Dave Benham’s JREN.BAT can do what you want. Requires some knowledge of JavaScript regular expressions.

HTH!

- SB
by Sponge Belly
04 Aug 2016 08:16
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205217

Re: JREPL.BAT - regex text processor - successor to REPL.BAT

Hi Foxi! :)

Sweden gave the world ABBA, Volvo, and Stieg Larsson.

We have Switzerland to thank for yodeling, cuckoo clocks, and Roger Federer.

Need I say more?

- SB
by Sponge Belly
01 Jul 2016 15:30
Forum: DOS Batch Forum
Topic: Regsrv32 exploit
Replies: 11
Views: 4709

Re: Regsrv32 exploit

Hi Vasil, Sorry for the delay in replying. I was referring to the SO link Jeb mentioned in his reply to the OP. If I understand correctly, the following Registry keys are queried every time a for /f loop is executed: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun HKEY_CURRENT_USER\S...
by Sponge Belly
06 May 2016 13:02
Forum: DOS Batch Forum
Topic: Regsrv32 exploit
Replies: 11
Views: 4709

Re: Regsrv32 exploit

Hi Guys! Fascinating discovery, but not even MS can ignore a security hole that big. No doubt it will be patched in an upcoming update. I’m more concerned with the AUTORUN issue, which I was unaware of until now. Short of querying the Registry to make sure the AUTORUN key is empty whenever I want to...
by Sponge Belly
27 Apr 2016 14:17
Forum: DOS Batch Forum
Topic: Can formfeed character be written to file
Replies: 5
Views: 2621

Re: Can formfeed character be written to file

npocmaka wrote:

Code: Select all

cls>>temp.txt


Excellent! :)
by Sponge Belly
27 Apr 2016 13:48
Forum: DOS Batch Forum
Topic: Passing batch argument to Choice command
Replies: 20
Views: 6918

Re: Passing batch argument to Choice command

Aacini wrote:

Code: Select all

set "vars=apl1=2,apl2=,apl3=kup,aplN=etc"
set "%vars:,=" & set "%"


Brilliant! 8)
by Sponge Belly
04 Apr 2016 13:17
Forum: DOS Batch Forum
Topic: Text Flow (like word wrapping to a margin) of free form text lines
Replies: 7
Views: 33577

Re: Text Flow (like word wrapping to a margin) of free form text lines

Hi John A!

Have a look at PrepMessage.cmd posted to alt.msdos.batch.nt by Frank P Westlake in January, 2013.

HTH! :)

- SB
by Sponge Belly
28 Nov 2015 08:18
Forum: DOS Batch Forum
Topic: revamped forum
Replies: 38
Views: 9413

revamped forum

Hello All! I’m just going to come right out and say it. I’m not happy with the revamped forum. I have several issues. First, I’m having difficulties loading the home page. Several attempts are usually required. I suspect the honking big Google Ads frame may have something to do with it. Next, the ‘V...
by Sponge Belly
22 Nov 2015 11:49
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 22347

Re: split string into substrings based on delimiter

Hello Again! Below is my revised code for trimming whitespace from the start and end of a string: @echo off & setlocal enableextensions disabledelayedexpansion :: nasty str full of poison chars set ^"str= ^^^" ^^^&^^ ^&^"^& %%os%% !random! ^" :: double all quotes ...