Search found 233 matches

by Sponge Belly
06 Jul 2013 08:34
Forum: DOS Batch Forum
Topic: Using setver with win98 boot disk and msdos 6.22 programs ?
Replies: 4
Views: 13554

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

Hi Again! :-)

Have you tried The CD Forum? The site is devoted to bootable CDs and boasts no less than 8 subforums. Surely one of the gurus there will be able to help you. And when he/she does, please come back and let us know what pearls of wisdom were bestowed on you. ;-)

- SB
by Sponge Belly
06 Jul 2013 05:48
Forum: DOS Batch Forum
Topic: %~z1 question
Replies: 6
Views: 11137

Re: %~z1 question

@npocmaka_: Welcome to DosTips! @Squashman: You’re absolutely right, as usual. I overlooked this line: SET "z1=%~z1" Dave had said previously that one solution would be to use delayed expansion, so I made a link where there was none and confused !1z! in Endoro’s snippet with the erroneous ...
by Sponge Belly
05 Jul 2013 16:56
Forum: DOS Batch Forum
Topic: %~z1 question
Replies: 6
Views: 11137

Re: %~z1 question

@Endoro: Thanks for the revised code! It never occurred to me that parameters could be referred to as “!~z1!” using delayed expansion. I don’t remember seeing it used before. I’ve seen “!%~1!”plenty of times, but that’s a whole other box of crayons. @Dave: Thanks for the great explanation. It makes ...
by Sponge Belly
04 Jul 2013 14:13
Forum: DOS Batch Forum
Topic: Using setver with win98 boot disk and msdos 6.22 programs ?
Replies: 4
Views: 13554

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

Hi Taripo! DOS 6.22 programs should run without any problems under Windows 98, or am I missing something? If you’re trying to execute an old DOS program under XP or higher, try right-clicking on it, selecting Properties from the pop-up menu, and click on the Compatibility tab… although I doubt if th...
by Sponge Belly
04 Jul 2013 13:21
Forum: DOS Batch Forum
Topic: DISKPART UNIQUEID=GUID failure. Why ? Any Alternatives ?
Replies: 2
Views: 9515

Re: DISKPART UNIQUEID=GUID failure. Why ? Any Alternatives

Hi Alan! :-)

Wow! I didn’t understand a word of that. Sounds like the kind of thing Fred Langa of Windows Secrets fame would sink his teeth into. Or have you solved the problem on your own in the meantime? Don’t leave us hanging in suspense! ;-)

- SB
by Sponge Belly
04 Jul 2013 13:09
Forum: DOS Batch Forum
Topic: Automation of Microsoft Forefront Endpoint Protection
Replies: 1
Views: 3152

Re: Automation of Microsoft Forefront Endpoint Protection

Hi KidHaxMan!

What did you type into Google? I just tried “microsoft forefront command line” and got lots of promising results.

Good luck! :-)

- SB
by Sponge Belly
04 Jul 2013 13:00
Forum: DOS Batch Forum
Topic: Help with batch file - combine 2 files
Replies: 1
Views: 3266

Re: Help with batch file - combine 2 files

Hello Rookie! Just noticed your post in the list of unanswered topics. You probably didn’t get any replies because you weren’t specific enough. Are the two files you wish to merge text files? Could you give a sample of both? And how do you want them merged? One after the other, or side by side? - SB
by Sponge Belly
02 Jul 2013 15:33
Forum: DOS Batch Forum
Topic: %~z1 question
Replies: 6
Views: 11137

%~z1 question

Dear DosTips, Please peruse the following snippet: if "%~1" neq "" ( if %~z1 equ 0 ( echo(file is empty ) else echo(file is not empty ) else echo(no cmdline args found If a filename is supplied on the command line, all is well. But if no filename is specified, the program throws ...
by Sponge Belly
02 Jul 2013 13:13
Forum: DOS Batch Forum
Topic: var inside for /f loop’s in (…) clause
Replies: 3
Views: 4142

Re: var inside for /f loop’s in (…) clause

Thanks Dave! The scary thing is that I actually understood your explanation. Another little piece of the puzzle has fallen into place. Anyways, for anyone still reading this topic, to make the LF variable work inside the for /f loop’s in (…) clause using delayed expansion, you would have to do the f...
by Sponge Belly
02 Jul 2013 07:10
Forum: DOS Batch Forum
Topic: var inside for /f loop’s in (…) clause
Replies: 3
Views: 4142

var inside for /f loop’s in (…) clause

Hello All! The little snippet below outputs the number and contents of any lines found in a user-specified file that don’t contain a Line Feed. And then it does it again. First using a bare findstr, and then using findstr wrapped inside a for /f loop’s in (…) clause. @echo off & setlocal enablee...
by Sponge Belly
16 Jun 2013 15:29
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 40080

new findstr bug

Dear DosTips, I tried piping a single character into findstr using set /p, type, and findstr itself. The results were the same: absolutely nothing! findstr silently gobbled it up. > <nul set /p "=#" | findstr /n "^" (no output) > <nul set /p "=##" | findstr /n "^&q...
by Sponge Belly
13 Jun 2013 13:11
Forum: DOS Batch Forum
Topic: [Solved] find or findstr prompt issue
Replies: 11
Views: 15384

Re: [Solved] find or findstr prompt issue

Hello All! Apologies for my late arrival to this topic. I hope it goes better than the last time I tried to revive an old thread! Anyways, Allal makes a valid point. However, there is a Batch solution to Bouchta’s problem. The following little program accepts a filename as argument and runs findstr ...
by Sponge Belly
25 May 2013 11:50
Forum: DOS Batch Forum
Topic: truncate files - a (pure?) batch solution
Replies: 3
Views: 10546

truncate files - a (pure?) batch solution

Hello All! Sometimes I’d like to snip off the newline from the end of a file. But there’s no efficient way to do it using pure Batch commands. Recently, I unearthed a Super User question on how to truncate a set amount of bytes from a file . The second answer gave a PowerShell solution. I know nothi...
by Sponge Belly
13 May 2013 10:00
Forum: DOS Batch Forum
Topic: How to detect if input comes from pipe or redirected file
Replies: 9
Views: 14579

Re: How to detect if input comes from pipe or redirected fil

Hello Jeb! Only found this earlier topic today. But my question still stands: I’m looking for a robust method to check for redirected input (ie, prog.cmd < file.txt). The program in the OP correctly identifies redirected input from a file. But like FPW says in the comments, it’s fragile, requires a ...
by Sponge Belly
05 May 2013 15:04
Forum: DOS Batch Forum
Topic: robust line counter
Replies: 22
Views: 30861

Re: robust line counter

Dammit, Foxi. You’re right. If a colon comes after a null character on a line of output from findstr /n "^" "%~1", find /c ":" will count it as two lines. That torpedos Ranguna173’s otherwise elegant solution. As to your second point, try this (note the null character o...