Search found 29 matches

by Eureka!
17 Oct 2019 14:13
Forum: DOS Batch Forum
Topic: Insert new line at certain line works but the lines starting with ; all gone, why?
Replies: 3
Views: 167

Re: Insert new line at certain line works but the lines starting with ; all gone, why?

";" is the default EOL character in FOR commands.
Use a dummy character that is not in the lines you want to parse (like "@") : eol=@

See FOR /? for details.
by Eureka!
17 Oct 2019 02:38
Forum: DOS Batch Forum
Topic: CAD start based on license Bundle check
Replies: 1
Views: 152

Re: CAD start based on license Bundle check

See code below for how I interpreted your requirements (not everything was clear to me). It is merely a rough sketch of the logic you could use; not read-to-run code. As I don't have enough time to visit this forum often (unfortunately), don't expect quick responses from me. But the good people on t...
by Eureka!
09 Oct 2019 14:57
Forum: DOS Batch Forum
Topic: Remove Microsoft header from cmd, for example when executing code from alternate data stream
Replies: 10
Views: 470

Re: Remove Microsoft header from cmd when executing code from alternative data stream

Or ...
add /K to your original command to get rid of the version info:

Code: Select all

>>%adsfile%:test%%i echo cmd /d /q /k ^<".\%adsfile%":test!next!
and

Code: Select all

cmd /d /q /k < %adsfile%:test1

Succes ermee! :)
by Eureka!
10 Sep 2019 05:44
Forum: DOS Batch Forum
Topic: Cmd For loop is allergic to certain file names
Replies: 6
Views: 718

Re: Cmd For loop is allergic to certain file names

As far as I can tell - don't have the source code of CMD - the for loop starts with the first file (sorted alphabetically by name), then proceeds with the alphabetically next one. If you rename a file so that it's inserted in the original list, that file will be picked up when it's alphabetically ne...
by Eureka!
08 Sep 2019 14:04
Forum: DOS Batch Forum
Topic: Looking for a specific book
Replies: 16
Views: 1227

Re: Looking for a specific book

Search tip: add "ISBN" to your search query to find books. Select images to see their covers.

BTW: Are you sure you didn't mix up batch and bash?
by Eureka!
04 Sep 2019 15:37
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 2378

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

aGerman wrote:
13 Aug 2019 10:45

Code: Select all

type "uri.tmp~"|clip.exe
dbenham wrote:
14 Aug 2019 05:58

Code: Select all

type %1.64 | clip
I was wondering if there was any technical reason for using the type file | clip syntax in this case instead of the clip < file one?
Or is this in the category "same difference" / personal preference?
by Eureka!
04 Sep 2019 15:22
Forum: DOS Batch Forum
Topic: testing the existence of restricted Subfolder without Admin
Replies: 1
Views: 940

Re: testing the existence of restricted Subfolder without Admin

Erzesel wrote:
25 Aug 2019 03:45
Possibly the whole thing is interesting for other users.
Yes it is! Thank you!
Did you test this with folder access over SMB too? (meaning a network folder; can't test it right now, but am very curious)

Nice discovery.
by Eureka!
04 Sep 2019 13:58
Forum: DOS Batch Forum
Topic: Batch script to remove duplicate rows while ignoring first few characters
Replies: 3
Views: 644

Re: Batch script to remove duplicate rows while ignoring first few characters

Without (part of) the actual text file, this might produce false results. But as you did't provide that: @echo off setlocal ::__________________________________________________ :: :: SETTINGS ::__________________________________________________ :: set LENGTH=8 set SUFFIX= set INPUT=INPUT.txt set TUS...
by Eureka!
31 Aug 2019 10:59
Forum: DOS Batch Forum
Topic: Bit Twiddling Hacks in Batch
Replies: 6
Views: 1129

Re: Bit Twiddling Hacks in Batch

Your concerns about decimal calculations are valid for things like division or modulus. Addition and subtraction are just single CPU operations. Multiplication is cheap, too. How do you know? Is there a thread about that on these forums? (still 7000+ topics to read ...) I did some quick tests and t...
by Eureka!
31 Aug 2019 10:43
Forum: DOS Batch Forum
Topic: Something is running in command prompt on startup.
Replies: 2
Views: 627

Re: Something is running in command prompt on startup.

When I start my computer, Do you mean: "When I log in after strating my computer" or does this happen *before* you log in? - Start task Manager (taskmgr.exe / Ctrl-Shift-Esc) - Go to the Startup tab - Right-click each entry and choose disable - Reboot and log in. If the "problem" is gone, re-enable...
by Eureka!
30 Aug 2019 09:53
Forum: DOS Batch Forum
Topic: File partly outputs to cmd prompt. String count error: (0 does not equal 1)
Replies: 9
Views: 1880

Re: File partly outputs to cmd prompt. String count error: (0 does not equal 1)

For every program there are multiple settings in the registry, like DisplayName, DisplayVersion, .. But not all programs have all settings defined (on my system this varies wildly from 0 to 30 settings). That's why the variables containing these settings have to be 'un-set' before the next program i...
by Eureka!
28 Aug 2019 09:29
Forum: DOS Batch Forum
Topic: File partly outputs to cmd prompt. String count error: (0 does not equal 1)
Replies: 9
Views: 1880

Re: File partly outputs to cmd prompt. String count error: (0 does not equal 1)

Does anyone know how to streamline the code so that there are not so many actions that need to be performed but at the same time produces the correct results please [like do I need all the C:\ 's before the file name etc]. This is what I wrote a couple of years ago. No guarantees, not tested (recen...
by Eureka!
27 Aug 2019 14:13
Forum: DOS Batch Forum
Topic: "bat" file keeps closing after executing
Replies: 5
Views: 1141

Re: "bat" file keeps closing after executing

For some reason after I "right click" and "run as Administrator" Be aware that if you start your script like that, you will end up with a completely different %USERNAME% if you weren't logged in as a local administrator. My advice: Split your script in a SYTEM part and a USER part. (although there ...