Search found 34 matches

by Simon_Weel
2024-Feb-26, 4:08 pm
Forum: Windows CMD Shell
Topic: Puzzled by Delims
Replies: 4
Views: 432

Re: Puzzled by Delims

Okay, changing tokens=2 solves the problem. It doesn't seem to matter whether delims==" or delims=^=" is used? For clarity, this is IMO the better option delims=^="
by Simon_Weel
2024-Feb-22, 3:45 pm
Forum: Windows CMD Shell
Topic: Puzzled by Delims
Replies: 4
Views: 432

Puzzled by Delims

I want to know the name / make of a pc. So I use this command: wmic csproduct get name /format:list This returns Name=HP Z240 Tower Workstation Now I would like to strip the Name= part, so I use this: FOR /F "usebackq tokens=* delims=Name=" %%F IN (`wmic csproduct get name /format:list ^| ...
by Simon_Weel
2024-Feb-22, 2:58 pm
Forum: Windows CMD Shell
Topic: Is there any universal way to redirect file operations to nul?
Replies: 4
Views: 490

Re: Is there any universal way to redirect file operations to nul?

I think it depends on the program you run? As soon as you start a program, cmd is no longer in control. That is, you can suppress the console output of a program (most of the times), but I don't think you can fiddle with any data operations the program performs.
by Simon_Weel
2024-Feb-20, 9:38 am
Forum: Windows CMD Shell
Topic: Certificate Storenames
Replies: 1
Views: 209

Certificate Storenames

Deploying certificates using a GPO isn't always working correct, so I decided to install certificates using the domain Startup-script. Certutil it is. CertificateStoreName turned out to be a bit difficult. I thought I could use the name listed in the Certificates MMC Snap-in, like "Trusted Publ...
by Simon_Weel
2024-Jan-08, 2:12 pm
Forum: Windows CMD Shell
Topic: TIMEOUT -T
Replies: 4
Views: 2445

TIMEOUT -T

Minor thing / nitpicking. The section about Timeout lists -T as option. Windows 10 doesn't need the T-option, like timeout 30 works just as well. Windows 10 also lists it as /T and not as -T.
by Simon_Weel
2023-Dec-11, 11:14 am
Forum: Windows CMD Shell
Topic: What is the best way to check for a disc in an optical drive?
Replies: 2
Views: 2091

Re: What is the best way to check for a disc in an optical drive?

Don't know if it's official, but maybe this could help? Like

Code: Select all

wmic logicaldisk where drivetype=5 get volumename
by Simon_Weel
2023-Nov-08, 2:59 pm
Forum: Windows CMD Shell
Topic: CMD DISM Language
Replies: 1
Views: 3278

Re: CMD DISM Language

Maybe this can help you? Look for heading 'Using silent configurations'.
by Simon_Weel
2023-Oct-09, 3:47 pm
Forum: Windows CMD Shell
Topic: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?
Replies: 2
Views: 10755

Re: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?

You could try to intercept the error text ' ERROR: Data Error in encrypted file. Wrong password? ' by piping the output of 7Zip to the Find command. Don't know the exact syntax for 7Zip, but maybe something like 7z L %userprofile%\downloads\file.7z | find /i "wrong password" And then check...