Search found 1160 matches

by ShadowThief
03 Jul 2023 10:16
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 4571

Re: How to escape comma in wmic?

lazna wrote:
03 Jul 2023 03:02
ShadowThief wrote:
02 Jul 2023 15:54
lazna wrote:
02 Jul 2023 12:45
just FYI: wmic is obsolette
no it isn't
Sorry for wrong word 'obsolette', wmic is deprecated
They removed the warning in Windows 11, so it's fair to say that it also isn't deprecated.
by ShadowThief
02 Jul 2023 15:54
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 4571

Re: How to escape comma in wmic?

lazna wrote:
02 Jul 2023 12:45
just FYI: wmic is obsolette
no it isn't
by ShadowThief
06 Jun 2023 14:13
Forum: DOS Batch Forum
Topic: cmd-Terminal menu: How to iterate a number of spaces given in a variable into another variable?
Replies: 5
Views: 1705

Re: cmd-Terminal menu: How to iterate a number of spaces given in a variable into another variable?

Truncating the output is the best move here, especially since Terminal doesn't respect the mode con command so you can't resize the window on the fly.
by ShadowThief
02 May 2023 16:34
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 9507

Re: Notepad bug

I can confirm it's present in Windows 11 as well.
by ShadowThief
24 Apr 2023 16:48
Forum: DOS Batch Forum
Topic: [SOLVED] chkdsk does not work when run from a BAT file
Replies: 4
Views: 1935

Re: chkdsk does not work when run from a BAT file

That's a result of you saving the file with the wrong encoding. Your batch script must be saved as ANSI or else it will not work correctly.
by ShadowThief
23 Apr 2023 10:01
Forum: DOS Batch Forum
Topic: Winrar not working in Win11 64 bits
Replies: 3
Views: 1460

Re: Winrar not working in Win11 64 bits

Your script should be getting some error if the file isn't being created; either you don't have write permissions to the file, or the drive is full, or your path to rar.exe isn't what you think it is. Again, without knowing what the exact error is, your question cannot be answered.
by ShadowThief
23 Apr 2023 04:30
Forum: DOS Batch Forum
Topic: Winrar not working in Win11 64 bits
Replies: 3
Views: 1460

Re: Winrar not working in Win11 64 bits

Hard to say without a description of what "isn't working." I've been using Winrar on Windows 11 since Windows 11 came out and it works perfectly on my machine. Just at a glance though, I'd recommend changing pushd C:\testrar\create rar to pushd "C:\testrar\create rar" since it looks like that folder...
by ShadowThief
22 Apr 2023 07:40
Forum: DOS Batch Forum
Topic: Convert R G B values into single 0 - 255 color value?
Replies: 20
Views: 22049

Re: Convert R G B values into single 0 - 255 color value?

Interesting, it seems that more sequences are supported than just the ones that are listed on https://learn.microsoft.com/en-us/windo ... -sequences

I'm going to have to do more research into this.
by ShadowThief
15 Apr 2023 17:50
Forum: DOS Batch Forum
Topic: [SOLVED] chkdsk does not work when run from a BAT file
Replies: 4
Views: 1935

Re: chkdsk does not work when run from a BAT file

There shouldn't be any problem. Open a command prompt and run the script from there instead of double-clicking it so that you can see what the error is.
by ShadowThief
21 Mar 2023 21:13
Forum: DOS Batch Forum
Topic: [SOLVED] Unable to rework working script due to name of folder and / or removal of sign -
Replies: 7
Views: 3907

Re: Unable to rework working script due to name of folder and / or removal of sign -

Wait, you actually have an exclamation point followed by a space in the name of your folder? Those are the two worst choices you could possibly make. Immediately rename the folder to just Scripts . Because you have delayed expansion enabled, the exclamation point has special meaning. You can try to ...
by ShadowThief
12 Mar 2023 19:02
Forum: DOS Batch Forum
Topic: Generic USB Drive Letter
Replies: 10
Views: 4930

Re: Generic USB Drive Letter

If your system has access to WMIC, you can define the USB drive letter as a variable rather easily like this: for /f "skip=2 tokens=2 delims=," %%g in ('%__APPDIR__%wbem\WMIC.exe logicaldisk where "drivetype=2" get DeviceID 2^>nul /format:csv') do set "usbDrive=%%g" Subsequently, you can use 'if de...
by ShadowThief
09 Mar 2023 00:10
Forum: DOS Batch Forum
Topic: My syntax is not correct
Replies: 3
Views: 13666

Re: My syntax is not correct

When you don't use the /C flag, then findstr takes everything in quotes to be a list of things to search for. findstr /B "OS Name:" tells findstr to look for both "OS" and "Name:"

Code: Select all

systeminfo | findstr /B /C:"OS Name:" >>"%~dpn0.txt"
systeminfo | findstr /B /C:"OS Version:" >>"%~dpn0.txt"
by ShadowThief
07 Mar 2023 22:41
Forum: DOS Batch Forum
Topic: How to ask for input
Replies: 2
Views: 1524

Re: How to ask for input

In this particular case, the line if /I %Drive% geq C & if %Drive% leq Z goto :Next1 is wrong because you can't chain two if statements together with an ampersand. All you have to do is have them one after the other like you do on the previous line. On a somewhat related note, it's pretty much alway...