Search found 222 matches
- 03 Apr 2013 03:48
- Forum: DOS Batch Forum
- Topic: multiple labels on one line
- Replies: 2
- Views: 2964
Re: multiple labels on one line
Hi Jeb! Thanks for replying. I read about the self-executing labels again. I think it’s starting to sink in. The less than in <:%bl.start% was confusing me. Now I get it. It has to be there to trick the parser into treating the line as a command and not a label, but goto treats labels literally and ...
- 02 Apr 2013 13:35
- Forum: DOS Batch Forum
- Topic: multiple labels on one line
- Replies: 2
- Views: 2964
multiple labels on one line
Hi Again! I was thinking of writing a subroutine that would do different things depending on the name it was called by. Pretty soon, it had a long list of labels before the main body of the subroutine. I was wondering if it’s possible to have multiple labels on the same line using some twisted trick...
- 02 Apr 2013 12:58
- Forum: DOS Batch Forum
- Topic: dot before equals in set /p
- Replies: 2
- Views: 2932
dot before equals in set /p
Hello All! I keep coming across lines of code like this: <nul set /p ".=some text" Why is there a dot before the equals sign? What does it do? It doesn’t seem to make any difference whether I leave it in or not. Is it for good luck? Does it keep the bugs away? Seriously, I presume it’s the...
- 02 Apr 2013 12:47
- Forum: DOS Batch Forum
- Topic: more bug citation needed
- Replies: 4
- Views: 3839
Re: more bug citation needed
Hi Squashman! That was you? Should have guessed. I tried googling, but the words more“” and “bug” are too common and I couldn’t sift through all the results. Thanks for the link… btw, what is Ed talking about in that thread? Near as I can tell, he’s trying to output a range of lines from a file. Did...
- 02 Apr 2013 10:45
- Forum: DOS Batch Forum
- Topic: more bug citation needed
- Replies: 4
- Views: 3839
more bug citation needed
Dear Batchers,
It was recently discovered that more will wait for a keypress after 65,535 lines, even if output is redirected to a file or sent down a pipe. But who was the first to report this bug? Is there a link to a post on a forum somewhere? I couldn’t find anything.
- SB
It was recently discovered that more will wait for a keypress after 65,535 lines, even if output is redirected to a file or sent down a pipe. But who was the first to report this bug? Is there a link to a post on a forum somewhere? I couldn’t find anything.
- SB
- 01 Apr 2013 06:52
- Forum: DOS Batch Forum
- Topic: VBS who gets text from URL and put it in .txt
- Replies: 4
- Views: 4221
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
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
- 31 Mar 2013 16:48
- Forum: DOS Batch Forum
- Topic: Another way to create a line feed variable
- Replies: 8
- Views: 11301
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...
- 23 Feb 2013 17:41
- Forum: DOS Batch Forum
- Topic: filter text with certutil
- Replies: 1
- Views: 2451
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....
- 05 Feb 2013 08:18
- Forum: DOS Batch Forum
- Topic: direct swap
- Replies: 1
- Views: 2294
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%...
- 04 Feb 2013 10:09
- Forum: DOS Batch Forum
- Topic: goto within block forces var re-evaluation
- Replies: 1
- Views: 2256
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...
- 04 Feb 2013 08:41
- Forum: DOS Batch Forum
- Topic: Generate nearly any character, including TAB, from batch
- Replies: 15
- Views: 45615
Re: Generate nearly any character, including TAB, from batch
Thanks Squashman! Good find.
- 03 Feb 2013 17:28
- Forum: DOS Batch Forum
- Topic: Generate nearly any character, including TAB, from batch
- Replies: 15
- Views: 45615
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...
- 15 Jan 2013 17:58
- Forum: DOS Batch Forum
- Topic: Output text without linefeed, even with leading space or =
- Replies: 18
- Views: 35998
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....
- 15 Jan 2013 16:54
- Forum: DOS Batch Forum
- Topic: Output text without linefeed, even with leading space or =
- Replies: 18
- Views: 35998
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...
- 23 Dec 2012 15:33
- Forum: DOS Batch Forum
- Topic: store nth line of file in variable
- Replies: 11
- Views: 14319
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...