Search found 2421 matches

by dbenham
08 Mar 2022 11:31
Forum: DOS Batch Forum
Topic: How to put inner quotes in outer quotes in "for" loop?
Replies: 10
Views: 9227

Re: How to put inner quotes in outer quotes in "for" loop?

I am not familiar with dsquery.exe, so I don't know if the commas in OU=MyOU,dc=mydomain,dc=local-l are important, or if they can be converted to spaces. But the FOR /F will convert unquoted commas into spaces. If that is the problem, then I think the following should work: FOR /F "tokens=*" %%a IN ...
by dbenham
03 Feb 2022 20:06
Forum: DOS Batch Forum
Topic: more tricks with certutil
Replies: 13
Views: 18966

Re: more tricks with certutil

Yes, it is frustrating when something has the potential to be extremely useful in a general sense, but then has a limitation that interferes with achieving the full potential.
by dbenham
11 Apr 2021 19:44
Forum: DOS Batch Forum
Topic: Clobbered cmd.exe!
Replies: 7
Views: 4215

Clobbered cmd.exe!

WTF :shock: :!: :evil: I just discovered my cmd.exe is suddenly missing, as are all my utility files that I keep in d:\utils and include in my PATH. God only knows what else is amiss. I did manage to find a copy of cmd.exe in Windows\SysWOW64. I think it happened a couple weeks ago when my computer ...
by dbenham
09 Apr 2021 16:36
Forum: DOS Batch Forum
Topic: Is there a way to obfuscate parts of a batch file?
Replies: 3
Views: 3166

Re: Is there a way to obfuscate parts of a batch file?

Also check out - https://www.dostips.com/forum/viewtopic.php?f=3&t=7990. Lots of good techniques there for obfuscating code. Nothing to obfuscate select portions, but that could certainly be developed. I feel like this topic has been explored fairly extensively, and I'm not too interested in revisit...
by dbenham
17 Mar 2021 06:59
Forum: DOS Batch Forum
Topic: Using multiple strings for FINDSTR - is this OK?
Replies: 3
Views: 3423

Re: Using multiple strings for FINDSTR - is this OK?

Variables to the rescue @echo off setlocal ::-- Define search strings set critical=/I^ /C:"ORA-"^ /C:"Fetch of Driver Member"^ /C:"Error: 3303"^ /C:"Error: 3304"^ /C:"Error: 3335"^ /C:"Error: 3336"^ /C:"Error: 3337"^ /C:"does not exist for the specified cube or you do not have access to it"^ /C:"Out...
by dbenham
03 Mar 2021 14:53
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 38
Views: 36915

Re: Foxidrive has left us

The 15th post in this thread says he died at 57 :(
Much too young.
by dbenham
03 Mar 2021 12:03
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 38
Views: 36915

Re: Foxidrive has left us

I don't know if you took the time to follow the link, but I feel he was almost saying farewell in that post...
by dbenham
03 Mar 2021 10:27
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 38
Views: 36915

Re: Foxidrive has left us

I just happened to reread this old post from foxidrive. It brings a tear to my eye every time I see it. :cry:


Dave Benham
by dbenham
02 Mar 2021 06:49
Forum: DOS Batch Forum
Topic: .cmd/.bat file size limit? Yes. 2GB
Replies: 2
Views: 3506

Re: .cmd/.bat file size limit? Yes. 2GB

Nice investigation. I never dreamed of testing such a thing. I always thought of the file size as "limitless", actually meaning bigger than I could ever need. But it makes sense that there would be a size limit, given that cmd must keep track of the byte offset within the file, and push that offset ...
by dbenham
25 Feb 2021 22:26
Forum: DOS Batch Forum
Topic: [How-To] Parse DateTime strings (PowerShell hybrid)
Replies: 14
Views: 8615

Re: [How-To] Parse DateTime strings (PowerShell hybrid)

aGerman wrote:
25 Feb 2021 16:20
Since ParseExact is always tried first, custom formats have higher priority.
Ah, cool. I assumed it would be in reverse. I see how it works now.

I also missed the culture variable option until just now.
by dbenham
25 Feb 2021 16:14
Forum: DOS Batch Forum
Topic: [How-To] Parse DateTime strings (PowerShell hybrid)
Replies: 14
Views: 8615

Re: [How-To] Parse DateTime strings (PowerShell hybrid)

If you include the ISO 8601 week number, then you should also add the week year. The week year and calendar year do not always match when dealing with a date within a week of january 1.
by dbenham
25 Feb 2021 15:44
Forum: DOS Batch Forum
Topic: [How-To] Parse DateTime strings (PowerShell hybrid)
Replies: 14
Views: 8615

Re: [How-To] Parse DateTime strings (PowerShell hybrid)

The documentation should specify that the output always uses the local time zone. The offset from UTC should be added to the output, preferably as minutes offset. Not all time zones are offset by an integral hour. I was surprised the custom format string works for input. I thought it was only used f...
by dbenham
24 Feb 2021 15:09
Forum: DOS Batch Forum
Topic: "msg" command runs from CmdPrompt but not from batch script
Replies: 3
Views: 3392

Re: "msg" command runs from CmdPrompt but not from batch script

Perhaps your batch script is corrupting your PATH variable?
by dbenham
22 Feb 2021 15:48
Forum: DOS Batch Forum
Topic: Colossal Cave Adventure in batch
Replies: 24
Views: 34030

Re: Colossal Cave Adventure in batch

I misremembered a bit. By default (behavior at start), the full location is given the first time you enter a room, and every 5th time you enter the room after that. If you use "look" (or "descr" for describe), then the long description will be prefaced with "Sorry, but I am not allowed to give more ...