Search found 93 matches

by sst
21 Jul 2018 13:06
Forum: DOS Batch Forum
Topic: Context Menu options using CMD.exe or Powershell
Replies: 7
Views: 7559

Re: Context Menu options using CMD.exe

PowerShell while powerful is not a right choice for shell tasks given the crazy slow startup time on first use after boot, probably the user must be more careful to not accidentally click on that item. I was pretty sure that there are other variables, as I mentioned about %V , but didn't take the ti...
by sst
19 Jul 2018 06:00
Forum: DOS Batch Forum
Topic: List of files on HDD
Replies: 7
Views: 6964

Re: List of files on HDD

@Compo, I don't like the weirdness of echo( and the confusion it causes, I only use it whenever I can't be sure that "/?" will not appear in the echo's parameter which in this case can not happen with file names, maybe you feel the same about that; I don't know, but you should at least use echo, to ...
by sst
14 Jul 2018 16:46
Forum: DOS Batch Forum
Topic: dir *3*.* does not work as expected
Replies: 3
Views: 4134

Re: dir *3*.* does not work as expected

Code: Select all

dir ????????*3*.*
Bypasses short file names but also file names with original length of less than 9
by sst
06 Jul 2018 06:23
Forum: DOS Batch Forum
Topic: Random number diff from cmd line vs double click
Replies: 17
Views: 15782

Re: Random number diff from cmd line vs double click

I got not even a single 32-digits hexadecimal number duplicated... I used the same method as yours which I had posted in previous replays to this thread, And as I said, it has a problem of producing sequences which have obvious patterns in them. sorting will just hides the pattern. On My i7 6700 PC...
by sst
05 Jul 2018 22:19
Forum: DOS Batch Forum
Topic: Random number diff from cmd line vs double click
Replies: 17
Views: 15782

Re: Random number diff from cmd line vs double click

Hmm, I have let it run for a couple of minutes at a time and output thousands of results and have not gotten a duplicate when adding. Just reran a test using addition with the seed coming from the thousandths seconds from WMIC. Ran for 6 minutes and got 4148 unique GUID strings. No duplicates. @ech...
by sst
05 Jul 2018 20:51
Forum: DOS Batch Forum
Topic: Random number diff from cmd line vs double click
Replies: 17
Views: 15782

Re: Random number diff from cmd line vs double click

Adding instead of multiplying seem to do the trick. I was roughly getting 674 strings generated a minute and when I was multiplying, I would roughly get 40+ strings with all zeros. When I changed to adding the seed, I got none. I tested two ways. REM Tested with these two lines set /a "hex=(!RANDOM...
by sst
05 Jul 2018 00:07
Forum: DOS Batch Forum
Topic: Random number diff from cmd line vs double click
Replies: 17
Views: 15782

Re: Random number diff from cmd line vs double click

Digging up this old thread just because. I was commenting on a question at StackOverFlow that was now deleted by the user where they were using this code to generate a 32 character string. @echo off REM Delay in milliseconds for random number generator to recycle. REM pathping -p 2000 -q 1 localhos...
by sst
20 Jun 2018 08:15
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 11194

Re: which wildcard can be used in this case??

If you don't need to access the matched file or know the exact file name, then using wildcard in combination with `IF` statement would suffice, but if there is a need to access the file afterwards (read contents of, know the exact file name, pass the file name to another program,...) then `FOR` stat...
by sst
11 Jun 2018 02:26
Forum: DOS Batch Forum
Topic: How to mask a blank inside nested quotes?
Replies: 11
Views: 9992

Re: How to mask a blank inside nested quotes?

@pstein Your are doing it the wrong way. You should reread my post carefully. Do not touch or escape the existing quotes, just add extra escaped quotes in the first and last position of FOR command. This is what you did: for /F "usebackq" %%L in (`^"%IMG7path%magick^" identify -ping -format "INC=%%[...
by sst
11 Jun 2018 01:12
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 7520

Re: Unable to understand how to use findstr...

Please note that my question is limited to findstr , because such a solution could be used for binary files too (which are my real target). That is not necessarily true. As far as I'm concerned, findstr on it's own, does not have the capability to filter specific line numbers. So the assumption tha...
by sst
10 Jun 2018 21:29
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 7520

Re: Unable to understand how to use findstr...

... One question: At the end of the last line a newline is added (in output.txt, a blank 6th line). Do you have an idea how this could be avoided? If the lines does not have leading white spaces or equal sign(=) `set /p "=!var!"<nul>outFile` can be used for that matter. On Vista and beyond set /p r...
by sst
09 Jun 2018 21:24
Forum: DOS Batch Forum
Topic: Help with removing line breaks and leading whitespace
Replies: 4
Views: 3927

Re: Help with removing line breaks and leading whitespace

As Squashman has pointed out, your specific task can be handled by a single line of FOR /F Your question is more about of regex usage rather than batch scripting, but to cover your curiosity here is the JREPL way call jrepl "[\r\n]|^ *| *$" "" /m /f "input.txt" /o "output.txt" Although you didn't as...
by sst
06 Jun 2018 04:41
Forum: DOS Batch Forum
Topic: JREN.BAT v2.8 - Rename files/folders using regular expressions
Replies: 78
Views: 164970

Re: JREN.BAT - Rename files/folders using regular expressions

@zorro101 Your .modd and .moff files have hidden or system attributes set. Most probably only hidden attribute as it seems from your screenshot. attrib -h *.m2ts.* ren 2017* 2018* If you want to restore the attributes after the rename operation, then before running the above code, first run attrib *...
by sst
04 Jun 2018 10:40
Forum: DOS Batch Forum
Topic: Stop Command Prompt Empty Line
Replies: 17
Views: 16383

Re: Stop Command Prompt Empty Line

Based on the contents of the batch files and the outputs you have posted, Your executable is responsible for printing blank lines to the console. But since the output is redirected, I can think of two reasons for that behavior: 1. Prog.exe is printing blank line to the stderr 2. Prog.exe is directly...
by sst
03 Jun 2018 18:46
Forum: DOS Batch Forum
Topic: Stop Command Prompt Empty Line
Replies: 17
Views: 16383

Re: Stop Command Prompt Empty Line

... @echo off @echo off :: Usage: NestBat [File (without extension) [File (without extension)]] > Batling.bat :: :: Ver 15/02/2018 (CC BY-SA 4.0) :: echo Generating ... :: For %%f in (%1*.dat) do ( echo :: echo ::*** %%f echo copy %%f DAT echo copy %%f.dta DTA echo copy %%f.dtt DTT echo :: :: For %...