Search found 4021 matches

by Squashman
15 Jun 2020 22:36
Forum: DOS Batch Forum
Topic: getting a forfiles result that shows file locations
Replies: 2
Views: 287

Re: getting a forfiles result that shows file locations

Code: Select all

forfiles /S /D -9/24/2007 /M *smith*.pdf /C "cmd /c echo @path"
by Squashman
11 Jun 2020 22:56
Forum: DOS Batch Forum
Topic: Recursively Delete File Types From A Named Folder Only
Replies: 2
Views: 351

Re: Recursively Delete File Types From A Named Folder Only

pmc181 wrote:
10 Jun 2020 14:20
I
This is a network file share server so I can't run powershell. I would like to use cmd's from a batch file.

Thanks,
Pmc181
That is fine if you want to use a batch file but it being a network file share does not rule out Powershell. In fact it probably makes the task easier.
by Squashman
11 Jun 2020 22:52
Forum: DOS Batch Forum
Topic: Batch hex edit offset from filename
Replies: 8
Views: 601

Re: Batch hex edit offset from filename

I feel like I responded to this one already somewhere... Do the HEX files contain hexadecimal characters, or are they regular ASCII characters? Is offset 3AE always on the same line? I looked everywhere before posting, apologies if you have answered this somewhere. The 3AE offset is always on the s...
by Squashman
09 Jun 2020 15:20
Forum: DOS Batch Forum
Topic: Find will NOT find EXACT input!
Replies: 3
Views: 412

Re: Find will NOT find EXACT input!

Just a couple of pointers for you that you have been shown in your previous questions but have not caught onto. I would highly recommend you follow these. undefined variable set "var=" Assigning a value to a variable set "var=value" Comparing values IF "%var%"=="foo" command Checking if a variable h...
by Squashman
04 Jun 2020 20:57
Forum: DOS Batch Forum
Topic: Batch substring code not working
Replies: 6
Views: 626

Re: Batch substring code not working

So in your previous thread you knew enough to set the FOR variable to an environmental variable before you manipulated it. for %%a in (%~1) do for /f "tokens=1*" %%b in ("!return.vars!") do ( set "return.normal=!%%a!" if defined return.normal ( set "return.normal=!return.normal:%%=%%3!" set "return....
by Squashman
01 Jun 2020 18:16
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.5 - regex text processor with support for text highlighting and alternate character sets
Replies: 462
Views: 344867

Re: JREPL.BAT - regex text processor - successor to REPL.BAT

VBS and JScript strings are limited to 2GB, which is where the restrictions come from. The /M option must load the entire file into a single string. Dave Benham And using the /M option has been the only way I know of to strip a Carriage Return out of the middle of a record. I just got a bunch of cr...
by Squashman
01 Jun 2020 10:31
Forum: DOS Batch Forum
Topic: Use 1 variable for all tokens in for-loop
Replies: 2
Views: 445

Re: Use 1 variable for all tokens in for-loop

Take out the /F option.

Code: Select all

SET str=test1 test2 test3
FOR %%A IN (%str%) DO @ECHO -%%A
by Squashman
28 May 2020 10:44
Forum: DOS Batch Forum
Topic: Telnet Scripting Tool v.1.0 by Albert Yale
Replies: 11
Views: 850

Re: Telnet Scripting Tool v.1.0 by Albert Yale

Still baffles me when people take screenshot of the console when it is so easy to copy the text from it and paste it into the forums.
by Squashman
27 May 2020 10:52
Forum: DOS Batch Forum
Topic: [SOLVED] SET adds space to variable?
Replies: 2
Views: 455

Re: SET adds space to variable?

You are assigning spaces to the left variable.
Best practice is to use quotes to surround the assignment

Code: Select all

FOR %%f IN ("%~1") DO SET "left=%%~nf" & SET "ext=%%~xf"
by Squashman
22 May 2020 11:57
Forum: DOS Batch Forum
Topic: simple batch command to copy few files
Replies: 1
Views: 444

Re: simple batch command to copy few files

We would love to help but it would really help us if you could supply the code you have already written and give us a bit more detail to the scope of the project and what you are having problems with.
by Squashman
22 May 2020 11:55
Forum: DOS Batch Forum
Topic: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like
Replies: 44
Views: 28301

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Hello! Thank you @dbenham for creating this batch file. For some reason I can't get it to execute properly. When I launch it, it seems to be calling cscript.exe but it hangs there. Any ideas what to do about this? Thanks again! tempsnip.png Just out of curiosity, do you know you can copy text from ...
by Squashman
13 May 2020 16:53
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 841

Re: Incorporate CALL into the script.

How about you show us what you tried?
by Squashman
13 May 2020 09:10
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 841

Re: Incorporate CALL into the script.

What is stopping you from using wevtutil.exe in the DO portion of the FOR command?
by Squashman
04 May 2020 09:46
Forum: DOS Batch Forum
Topic: Code cmd (input)
Replies: 2
Views: 1142

Re: Code cmd (input)

You are doing a string comparison. The value on the left must equal the value on the right, character for character. That includes the quotes. You are also not using the correct comparison operator. It should be ==. You are also missing a closing parentheses.