Search found 4126 matches

by Squashman
12 Apr 2021 18:18
Forum: DOS Batch Forum
Topic: Clobbered cmd.exe!
Replies: 5
Views: 115

Re: Clobbered cmd.exe!

Any chance you can restore to a previous restore point?

I know on previous versions of Window the backup functionality blew chunks but it has worked flawlessly for me since I started using it with Windows 7. It has saved me butt a few times when drives failed.
by Squashman
05 Apr 2021 10:53
Forum: DOS Batch Forum
Topic: How do I convert batch script arguments to pattern?
Replies: 6
Views: 502

Re: How do I convert batch script arguments to pattern?

PiotrMP006 wrote:
05 Apr 2021 02:27
Names without spaces do not have quotation marks (Total Commander %S).
What about names with an ampersand and other special characters?

I am also concerned about your usage of the exclamation point. As that has special meaning in batch files as well when delayed expansion is enabled.
by Squashman
04 Apr 2021 10:27
Forum: DOS Batch Forum
Topic: JREPL to extract unique values from 16million row file?
Replies: 6
Views: 299

Re: JREPL to extract unique values from 16million row file?

Dave's JSORT might be another option for you as well. That would give you all the unique values in the 8th delimited field but would also give you the whole record. But again, you could use a FOR /F to parse the output of JSORT from inside the IN clause.
by Squashman
04 Apr 2021 10:20
Forum: DOS Batch Forum
Topic: JREPL to extract unique values from 16million row file?
Replies: 6
Views: 299

Re: JREPL to extract unique values from 16million row file?

Technically speaking a well formatted delimited file could be read by a FOR /F command. Only drawback to using a FOR /F is that it will load the entire file into memory and will fail if the file is larger than the 32Bit limit. Roughly 2.1GB's.
by Squashman
31 Mar 2021 15:29
Forum: DOS Batch Forum
Topic: Close CMD after running batch
Replies: 1
Views: 276

Re: Close CMD after running batch

Remove cmd.exe /K
by Squashman
30 Mar 2021 15:31
Forum: DOS Batch Forum
Topic: read sfc output
Replies: 4
Views: 329

Re: read sfc output

The first thing I would check if it is writing everything to the STDOUT, STDERR or CON. If you redirect standard error to a file, then you know it is writing to STDERR. If your redirect STDOUT to a file and it doesn't go to file then it is writing directly to the console and you will not be able to ...
by Squashman
30 Mar 2021 15:20
Forum: DOS Batch Forum
Topic:  -
Replies: 8
Views: 474

Re: Batch treat special characters as input errors

I will give a slightly different option that uses the CHOICE command. By utilizing the choice command you don't have to validate the input because the CHOICE command defines the allowable input characters. Since the CHOICE command only allows for single character input I have changed your input to r...
by Squashman
30 Mar 2021 06:58
Forum: DOS Batch Forum
Topic:  -
Replies: 8
Views: 474

Re: Batch treat special characters as input errors

What is wrong with the help you got on StackOverFlow?
by Squashman
29 Mar 2021 07:08
Forum: DOS Batch Forum
Topic: Command prompt - combining files by name
Replies: 13
Views: 982

Re: Command prompt - combining files by name

I do get some sort of strange error message (something like: "%%a unexpected at this moment") though, so it's probably related to that? Were you running the code from the cmd prompt or from a .bat file? Hi, I was running the code from the cmd prompt. From the help file of the FOR command. FOR %vari...
by Squashman
27 Mar 2021 12:14
Forum: DOS Batch Forum
Topic: Identify Java software installed.
Replies: 5
Views: 374

Re: Identify Java software installed.

this did not work - gave error (For /F "Delims=" %%G in ('^ wmic product get description ^| findstr /lic: "java"^ )Do For %%O in (%%G)Do Echo(%%O ) >"remove_java.cmd" D:\JV>(For /F "Delims=" %G in (' wmic product get description | findstr /lic: "java" ) Do For %O in (%G) Do Echo(%O ) 1>"remove_java...
by Squashman
26 Mar 2021 14:32
Forum: DOS Batch Forum
Topic: Batch script that runs batchscripts
Replies: 1
Views: 295

Re: Batch script that runs batchscripts

You have way over complicated this. You don't need to sit there and check if the program you just executed is still running before running the next. Replace all of this. :: the file to run start run_inp_in_AtenaConsole.bat :: the loop it to check the n calculation is running else ( start calculation...
by Squashman
25 Mar 2021 11:12
Forum: DOS Batch Forum
Topic: Command prompt - combining files by name
Replies: 13
Views: 982

Re: Command prompt - combining files by name

Iceman123 wrote:
25 Mar 2021 10:14
I do get some sort of strange error message (something like: "%%a unexpected at this moment") though, so it's probably related to that?
Were you running the code from the cmd prompt or from a .bat file?
by Squashman
25 Mar 2021 08:02
Forum: DOS Batch Forum
Topic: bat file only by computer name
Replies: 2
Views: 346

Re: bat file only by computer name

I see part of your problem was solved on StackOverFlow but nobody gave you direction on substrings of variables. This is explained in the help file for the `SET` command. May also specify substrings for an expansion. %PATH:~10,5% would expand the PATH environment variable, and then use only the 5 ch...
by Squashman
22 Mar 2021 07:39
Forum: DOS Batch Forum
Topic: Command prompt - combining files by name
Replies: 13
Views: 982

Re: Command prompt - combining files by name

Penpen I always thought if it was an NTFS drive, it would process them in ascii order.