Search found 2244 matches

by dbenham
15 Aug 2019 12:20
Forum: DOS Batch Forum
Topic: Newly discovered pipe behavior - and a fun challenge!
Replies: 5
Views: 1859

Newly discovered pipe behavior - and a fun challenge!

Over at https://stackoverflow.com/a/57492041/1012053 jeb deduced a newly discovered behavior of Windows pipes. We had all thought that each side of a pipe is always executed in a new cmd.exe process via CMD /S /D /C. Well it turns out cmd.exe is only used if the command is an internal command, or if...
by dbenham
14 Aug 2019 05:58
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 1746

Re: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?

As aGerman said, you cannot avoid creating a file. But if your goal is to put the result on the clipboard, then there is no need for an environment variable. You can simply TYPE the output file and pipe it into the CLIP utility. Also, the -encodehex verb has options that allow you to create base64 u...
by dbenham
23 Jul 2019 13:47
Forum: DOS Batch Forum
Topic: Change the value of errorlevel for testing purposes
Replies: 2
Views: 1840

Re: Change the value of errorlevel for testing purposes

I need to change a line in some old scripts from this If Not ERRORLEVEL 0 ( to this IF %errorlevel% NEQ 0 In case you don't know, those two statements give entirely different results. IF NOT ERRORLEVEL 0 only returns TRUE if ERRORLEVEL is less than 0. It returns FALSE if greater than or equal to 0....
by dbenham
21 Jul 2019 19:16
Forum: DOS Batch Forum
Topic: Problem with "start" command
Replies: 5
Views: 2703

Re: Problem with "start" command

The /D option is used to specify the path to the directory containing your target (your file). It should not include the file name. Also, if the first argument is quoted, then it must be your window title. As aGerman said, if the log.txt is in the current directory, then remove the /D option altoget...
by dbenham
18 Jul 2019 21:12
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.3 - regex text processor with support for text highlighting and alternate character sets

I am writing MediaWiki to PMwiki converter and am finding JREPL extremely useful. I have found two syntax that v8.3 does not handle correctly. Any suggestions would be greatly appreciated. ::SYNTAX EXAMPLES MEDIAWIKI PMWIK ::Images [[Image:wiki.jpg]] Attach:foo.jpg jrepl_v8_3.bat "[[Image:" "Attach...
by dbenham
16 Jul 2019 11:36
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.3 - regex text processor with support for text highlighting and alternate character sets

I replaced v8.2 with v8.3 - The only change is to the documentation - Binary files with null bytes may be read with either the /M option, or else via ADO.


Dave Benham
by dbenham
16 Jul 2019 10:50
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

@onlinestatements Oh my goodness - I just realized there is a simple solution for reading files with null bytes without using the /M option :!: :D It is the Windows Script Host's TextStream.ReadLine method that is unable to read binary data with null bytes. But JREPL already gives you the option to ...
by dbenham
16 Jul 2019 05:24
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

onlinestatements wrote:
15 Jul 2019 21:15
Do you think SED or GREP from GNUWIN32 tools might help me with my problem?
Certainly not grep, as it only does searches, not replace.

I believe sed will work, but I wouldn't know how to do it. You should probably look elsewhere for help with sed.


Dave Benham
by dbenham
16 Jul 2019 05:12
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

Izya Kurvitch wrote:
15 Jul 2019 16:51
It replaces the text but exits of the script. Thank you very much!
JREPL.BAT is a batch script (that just happens to incorporate JSCRIPT). Like any other batch script, you must use CALL JREPL if you want to execute JREPL within another batch script and return.


Dave Benham
by dbenham
15 Jul 2019 12:31
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

OK, I remember this situation now. No, I don't have a solution for you. JScript has an inherent problem reading lines if the data contains null bytes. The only way JScript can reliably read null bytes is to read the entire file into memory as binary data, which is how the JREPL /M option works. I ca...
by dbenham
11 Jul 2019 11:30
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205221

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

onlinestatements wrote:
11 Jul 2019 11:22
Is it possible yet to tell jrepl to only search line numbers 3 thru 10?
I have the latest 8.2 version
It is all documented within the built in help.

Option /INC 3:10 will restrict the search to lines 3 through 10


Dave Benham
by dbenham
11 Jul 2019 11:02
Forum: DOS Batch Forum
Topic: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat
Replies: 20
Views: 10945

Re: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat

Is there any way to get the actual week number of the year to be output or set in variable for further reference? as a TV broadcast company we need that week number out the 52 weeks? Everything is fully documented in the built in help: JTIMESTAMP /? or JTIMESTAMP /?? for paged help If you want the ...
by dbenham
29 Jun 2019 13:57
Forum: DOS Batch Forum
Topic: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like
Replies: 29
Views: 14164

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Not sure if this could be considered a bug report (or if you can do anything about it), but if you have a file with more than 256 characters hashsum.bat throws an ERROR (which is correct), but it be "more" correct / helpful if it would say "why" this error occured More than 256 chars in the file co...
by dbenham
26 Jun 2019 21:33
Forum: DOS Batch Forum
Topic: JREN.BAT v2.8 - Rename files/folders using regular expressions
Replies: 56
Views: 37965

Re: JREN.BAT v2.8 - Rename files/folders using regular expressions

Why do you think you need JREN.BAT for this? You have the exact source and target name for each rename operation, so just use the REN command.

Code: Select all

for /f "delims=, tokens=1,2" %A in (1.csv) do @ren "%~B" "%~A"

Dave Benham
by dbenham
26 Jun 2019 07:49
Forum: DOS Batch Forum
Topic: Copying CMD.exe using batch file?
Replies: 3
Views: 1148

Re: Copying CMD.exe using batch file?

If you know that you want to copy the contents of the window before the window content is generated, then you can use the CLIP command. For example dir | clip But only the output is captured, not the command itself. If you want the commands to be included, then put the commands in a batch file with ...