Search found 202 matches

by Sponge Belly
01 Apr 2013 06:52
Forum: DOS Batch Forum
Topic: VBS who gets text from URL and put it in .txt
Replies: 4
Views: 2141

Re: VBS who gets text from URL and put it in .txt

Hi Websec!

Have a look at abc0502’s program in the last user posted on forum topic. You should be able to modify his code to suit your needs. If you run into any more problems, feel free to post a question here, but I don’t know much about VBScript. Good luck!

- SB
by Sponge Belly
31 Mar 2013 16:48
Forum: DOS Batch Forum
Topic: Another way to create a line feed variable
Replies: 8
Views: 5759

Re: I there a way for save the result of Prompt $_

Hi Carlos! Borrowing from Walid2mi’s technique for splitting a CRLF pair (see seventh answer), and Jeb’s explanation of how newline variable hack works , I came up with this… @echo off & setlocal enableextensions set lftmp=%tmp%\lf.tmp echo(| (pause >nul & findstr "^" >%lftmp%) <nu...
by Sponge Belly
23 Feb 2013 17:41
Forum: DOS Batch Forum
Topic: filter text with certutil
Replies: 1
Views: 1212

filter text with certutil

Hello All! Herbert Kleebauer recently posted this article on the alt.msdos.batch.nt newsgroup. He demonstrates how to filter out all control characters and extended ASCII characters from an input file using the wondrous certutil. The possibilities for certutil are endless. It’s my new favourite toy....
by Sponge Belly
05 Feb 2013 08:18
Forum: DOS Batch Forum
Topic: direct swap
Replies: 1
Views: 1228

direct swap

Hello All! Came across a post about swapping values by Joey recently. Haven’t seen anything similar elsewhere so I thought I’d share it with you. Try this out: set "fruitA=apples" & set "fruitB=bananas" set fruit set "fruitA=%fruitB%" & set "fruitB=%fruitA%...
by Sponge Belly
04 Feb 2013 10:09
Forum: DOS Batch Forum
Topic: goto within block forces var re-evaluation
Replies: 1
Views: 1137

goto within block forces var re-evaluation

Greetings! I read an interesting Experts Exchange topic . Search for the Goto Issue section. The example given by Qlemo goes something like this: set fruit=apples if 1==1 ( echo(%fruit% set fruit=bananas goto nextline :nextline echo(%fruit% ) Pretty cool, huh? But wait, it gets better! I thought thi...
by Sponge Belly
03 Feb 2013 17:28
Forum: DOS Batch Forum
Topic: Generate nearly any character, including TAB, from batch
Replies: 15
Views: 28235

Re: Generate nearly any character, including TAB, from batch

Hello All! Good news for those who don't have forfiles on their systems: MVP Daniel Petri wrote an article on the Windows 2000 Resource Kit that contains download links to many of the tools in said kit, including forfiles. But the link is to an early release that doesn't do the hex escapes. Fortunat...
by Sponge Belly
15 Jan 2013 17:58
Forum: DOS Batch Forum
Topic: Output text without linefeed, even with leading space or =
Replies: 13
Views: 12190

Re: Output text without linefeed, even with trailing space o

Oops! I checked and find can output Unicode and findstr can't. But find is no good either because it appends CR+LF to output. Sorry about that... Can type work with Unicode files from a cmd /u subshell? I seem to recall some discussion about this before, but of course I can't remember when or where....
by Sponge Belly
15 Jan 2013 16:54
Forum: DOS Batch Forum
Topic: Output text without linefeed, even with leading space or =
Replies: 13
Views: 12190

Re: Output text without linefeed, even with trailing space o

Hi Jeb and welcome back. Brilliant workaround for the "echo without linefeed" problem. Wish I'd thought of it! I had thought of using copy /a, but I didn't know how to get rid of the CtrlZ at eof. Never occurred to me to combine it with the /b switch for the destination file. One tiny sugg...
by Sponge Belly
23 Dec 2012 15:33
Forum: DOS Batch Forum
Topic: store nth line of file in variable
Replies: 10
Views: 5943

Re: store nth line of file in variable

Hi Again! I've written a program to copy a line from a text file and save it to a new file. It uses more, findstr, and temporary files to do the heavy lifting so it should work for lines >8191 characters. I won't include the program here because much of the code is similar to my previous effort. But...
by Sponge Belly
12 Dec 2012 14:50
Forum: DOS Batch Forum
Topic: Quotes, Parens, and GOTOs in Delayed Expansion
Replies: 1
Views: 1196

Quotes, Parens, and GOTOs in Delayed Expansion

Hello All! I have the following block of code in my win2unix program: setlocal enabledelayedexpansion if "%~1"=="" (if /i "!cmdcmdline!"=="!cmdcmdline:%~n0=!" ( endlocal & goto usage)) else ( if /i "!cmdcmdline!" neq "!cmdcmdline:%~n0=!"...
by Sponge Belly
03 Dec 2012 15:00
Forum: DOS Batch Forum
Topic: bowling, anyone?
Replies: 7
Views: 4752

bowling, anyone?

Hi Everyone! Since Christmas is a time for nostalgia, I thought I'd remind you about Elf Bowling. It was first released by NVision Design back in November, 1999. It instantly went viral and many sequels followed. But the original is surprisingly difficult to get hold of... until now! There's a link ...
by Sponge Belly
24 Nov 2012 15:54
Forum: DOS Batch Forum
Topic: Another take on safe string replace
Replies: 19
Views: 6818

Re: Another take on safe string replace

Hi Carlos! I have learnt the hard way not to bother Liviu until he's had his morning coffee See Jeb's answer in this SO thread for an example of safe string return. And once you've absorbed that , you can try bending your mind around Dave Benham's Macros with Arguments . Dave says you can wrap any f...
by Sponge Belly
23 Nov 2012 15:36
Forum: DOS Batch Forum
Topic: Batch findstr with quotes
Replies: 5
Views: 3120

Re: Batch findstr with quotes

Hi Raam! Welcome to DosTips. Maybe something like this might help... findstr /bl ^"\"%~1\"^" Remember that the dot (.) in the IP address is a findstr metacharacter and should either be escaped with a backslash (\) or turned off with findstr's /l (literal) switch. Also, I'm guessi...
by Sponge Belly
23 Nov 2012 14:45
Forum: DOS Batch Forum
Topic: store nth line of file in variable
Replies: 10
Views: 5943

Re: store nth line of file in variable

Thanks Ed!

That's what I thought.

Will file that link away for future reference.

Btw, who broke the bad news about more's 64k line limit? Does anyone have a link for that? I like to cite references in my blog posts whenever practicable.