Search found 1161 matches

by ShadowThief
13 Jul 2023 19:18
Forum: DOS Batch Forum
Topic: Unable to produce truthful info about deletion or lack of thereof [SOLVED]
Replies: 8
Views: 2403

Re: Unable to produce truthful info about deletion or lack of thereof

Delete the folder instead of emptying it, then use if exist to see if the folder is there. dir will always return something when it's inside of a folder that exists, so it's always going to return an %errorlevel% of zero.
by ShadowThief
03 Jul 2023 10:16
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 4729

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: 4729

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: 1765

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: 9741

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: 2015

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: 1519

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: 1519

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: 22310

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: 2015

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: 4061

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: 5094

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: 13873

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"