Search found 1910 matches

by penpen
05 Jul 2013 12:07
Forum: DOS Batch Forum
Topic: Using setver with win98 boot disk and msdos 6.22 programs ?
Replies: 4
Views: 3723

Re: Using setver with win98 boot disk and msdos 6.22 program

I'm not sure as some time has passed, since i used win98, but i think i remember the following: If you have program that is designed for a specific OS Version (here MS DOS 6.22) and you want to run it under a higher Version (here Win98 4.11.1998), then you have to use setver to tell your OS (Win98) ...
by penpen
03 Jul 2013 05:38
Forum: DOS Batch Forum
Topic: search & copy
Replies: 8
Views: 3965

Re: search & copy

Ups... sorry for that, here is the corrected version:

Code: Select all

findstr "word1.*word2 word2.*word1" "%%a" >nul && copy "%%a" "c:\folder2" >nul
by penpen
03 Jul 2013 04:55
Forum: DOS Batch Forum
Topic: Reg query to display silent
Replies: 1
Views: 4052

Re: Reg query to display silent

Using >nul twice is not useful, as it does the same as one >nul: It writes the output of the standard output to the nul device. Your problem is, that the output of the standard error stream (STDERR) is still written to the console window. You can avoid this by redirecting STDERR (with handle 2) to t...
by penpen
03 Jul 2013 04:27
Forum: DOS Batch Forum
Topic: search & copy
Replies: 8
Views: 3965

Re: search & copy

@glob5 This time you have good luck, that you can meet your new task with only changing foxidrive's code slightly. Just change the content of the for loop a little bit to: findstr "word1.*word2" "%%a" >nul && copy "%%a" "c:\folder2" >nul
by penpen
03 Jul 2013 04:11
Forum: DOS Batch Forum
Topic: how to read input from a pipe
Replies: 9
Views: 5331

Re: how to read input from a pipe

Thanks, i haven't seen the link on first read.
Sorry for that, i should not read and post around 3:00 am.
by penpen
02 Jul 2013 18:37
Forum: DOS Batch Forum
Topic: how to read input from a pipe
Replies: 9
Views: 5331

Re: how to read input from a pipe

I have just tested the batch from the second link Squashman has given. The result, when naming this batch redir.bat and creating a non empty test.txt, is as follows Z:\Temp\batch>echo:something | redir.bat 3< test.txt 4< test.txt 5< test.txt 6< test.txt 7< test.txt 8< test.txt 9< test.txt Input type...
by penpen
02 Jul 2013 18:09
Forum: DOS Batch Forum
Topic: how to read input from a pipe
Replies: 9
Views: 5331

Re: how to read input from a pipe

https://groups.google.com/forum/m/#!top ... dX14-F_Aks Sry I cannot read this, as i have no account there. I only get an loginscreen. But the detection of piped and redirected input is quite cool , i never learn out. So, normally this is transparent to a program, as it normally doesn't affect any o...
by penpen
02 Jul 2013 17:36
Forum: DOS Batch Forum
Topic: Take webpage input to generate and run a batch file...
Replies: 1
Views: 2479

Re: Take webpage input to generate and run a batch file...

It's not clear if you would accept a batch file with a menue, but i've just found an old batch, that can easily be adjusted, to create a printer menu: :programEntryPoint @echo off setlocal enableDelayedExpansion call :newMenu MENU set "MENU.TITLE=Please select a printer to install, or quit.&quo...
by penpen
02 Jul 2013 17:11
Forum: DOS Batch Forum
Topic: how to read input from a pipe
Replies: 9
Views: 5331

Re: how to read input from a pipe

Ad 1) You cannot check, if data is in the pipe without reading it, when using batch commands only. You may write a program in C++ to check this and call this self created executeable from within the batch program. I am not firm enough with JScript and VBS to know if that is possible with these langu...
by penpen
02 Jul 2013 16:07
Forum: DOS Batch Forum
Topic: data 5 sets
Replies: 1
Views: 1793

Re: data 5 sets

You haven't fully specified your problem. For example you need to describe, how you determine where the data in the beach field ends, as colon and comma are valid characters in there. For instance you may have two export cases: - first export case 1.C:Lo:La:B:T 2.c:lo:la:b:t - second export case (th...
by penpen
30 Jun 2013 07:34
Forum: DOS Batch Forum
Topic: Add heading between lines in text document
Replies: 13
Views: 6163

Re: Add heading between lines in trext document

Only a leading colon will be affected. That can be worked around too No, Aacini has used the for option "tokens=1,2", that means only the first to tokens were passed to the for loop. It does not mean, that tokenizing ends after the first token and the rest of the line can be accessed as t...
by penpen
30 Jun 2013 05:31
Forum: DOS Batch Forum
Topic: Add heading between lines in text document
Replies: 13
Views: 6163

Re: Add heading between lines in trext document

There are two minor bugs in this batch program: - if the text contains a colon, then all after that was cut of, and - a missing endlocal But this is easy to fix: @echo off setlocal EnableDelayedExpansion set name= for /F "tokens=1* delims=:" %%a in ('findstr /N "^" C:\Projects\Sc...
by penpen
26 Jun 2013 03:24
Forum: DOS Batch Forum
Topic: Efficiently passing multiple switches to a batch file?
Replies: 6
Views: 5122

Re: Efficiently passing multiple switches to a batch file?

Using the set command on all parameter and doing string operations on it is a real good idea Squashman. Up to now i did it in similar way as Aacini has done it. But you may max your idea out: @echo off setlocal rem Erase all existent variables to show the created ones at end for /F "delims==&qu...
by penpen
25 Jun 2013 19:41
Forum: DOS Batch Forum
Topic: Return character of specific position in a line
Replies: 16
Views: 8698

Re: Return character of specific position in a line

Hi, i hope this post is not too late, but i think the efficiency could be improved by using the buffer capacity of STDIN and STDERR, the match.txt receives the redirected output of STDIN and nomatch.txt that of STDERR. This solution advantages are: - not to use more than one file handle per outputfi...
by penpen
24 Jun 2013 16:07
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 15259

Re: new findstr bug

I have thought of sending the following as private message, but if 50% of posters have problems with what i wrote, there may be much more readers with the same problem, so i have decided to post this. I'm not sure what problem you have with these two examples, so i try a detailed explanation of: 1) ...