Search found 154 matches

by PAB
02 Sep 2025 08:04
Forum: DOS Batch Forum
Topic: Format totals with thousands separator and convert bytes to megabytes
Replies: 4
Views: 606

Re: Format totals with thousands separator and convert bytes to megabytes

Thanks elzooilogico and T3RRY for taking the time to answer. T3RRY, unfortunately, that is way beyond my capabilities but I will spend some time trying to figure it out and adapt it to my code. I am just an old bloke scanning the Internet for pieces of code to put together and adapt to get the task ...
by PAB
02 Sep 2025 05:29
Forum: DOS Batch Forum
Topic: Format totals with thousands separator and convert bytes to megabytes
Replies: 4
Views: 606

Format totals with thousands separator and convert bytes to megabytes

Good afternoon. I have come up with the following code which now works great. However, I am having trouble formatting the output. I would like the thousands separator in both the files totals [ #,##0 ] and the size totals [ #,###.00 ], along with the size totals being in MB's instead of Bytes and wi...
by PAB
29 Aug 2025 14:08
Forum: DOS Batch Forum
Topic: Problem getting folder sizes
Replies: 0
Views: 904

Problem getting folder sizes

Good evening. I hope all are well. I have the following code which works besides getting the folders total sizes. @echo off set "gtSize=25" PowerShell ^ $ErrorActionPreference='SilentlyContinue'; ^ $CMD=Get-ChildItem -Path D:\ -Directory -Depth 0 ^| Sort-Object -Property {$_.FullName}; ^ $Size=[Math...
by PAB
01 Jul 2025 00:34
Forum: DOS Batch Forum
Topic: Get set /p to accept file suffix.
Replies: 11
Views: 17991

Re: Get set /p to accept file suffix.

Thank you SO much Steffen,

That's perfect. I wouldn't have got that in a million years.

Thanks again.
by PAB
30 Jun 2025 14:19
Forum: DOS Batch Forum
Topic: Get set /p to accept file suffix.
Replies: 11
Views: 17991

Re: Get set /p to accept file suffix.

Thanks Steffen,

Yes, pre-pending the Asterisk and Decimal Point would be quite good although adding it in the set /p doesn't seem to work for me !

Thanks in advance.
by PAB
30 Jun 2025 04:16
Forum: DOS Batch Forum
Topic: Get set /p to accept file suffix.
Replies: 11
Views: 17991

Re: Get set /p to accept file suffix.

Thanks again. Here is a cut down version of my code where .xls does not work but *.xls for example works great. @echo off setlocal EnableDelayedExpansion set "Suffix=" echo. & set /p "Suffix=>Enter the [Suffix File Type] starting with the [Asterix] followed by the [Decimal Point] and press <Enter>: ...
by PAB
30 Jun 2025 01:38
Forum: DOS Batch Forum
Topic: Get set /p to accept file suffix.
Replies: 11
Views: 17991

Re: Get set /p to accept file suffix.

Thanks everyone for the replies. Yes, it does work if there is an Asterix and a Decimal Point at the beginning, but if you just put in .xls for example it doesn't ! I might try and look later to see if I can get it to automatically put in the *. in the set /p so the user doesn't need to. Thank again...
by PAB
29 Jun 2025 03:28
Forum: DOS Batch Forum
Topic: Get set /p to accept file suffix.
Replies: 11
Views: 17991

Get set /p to accept file suffix.

Good morning, I am wanting to input a file suffix such as *.xls* [ includes decimal point and asterix ] into a set /p variable which will then get used within the script, but for some reason I can't get it to work. Here is the relevant part . . . set "User_Input=" set /p "User_Input=>Enter the 'File...
by PAB
24 Feb 2025 13:46
Forum: DOS Batch Forum
Topic: Put Desktop to sleep from Laptop
Replies: 5
Views: 12664

Re: Put Desktop to sleep from Laptop

Thanks for the reply miskox , Unfortunately that has nothing to do with my problem. The Desk_Sleep.bat on the Desktop computers Desktop runs correctly if I run it directly on the Desktop computers Desktop. What I need is to be able to run [EXECUTE] Desk_Sleep.bat from my Laptop. Thanks again.
by PAB
24 Feb 2025 06:58
Forum: DOS Batch Forum
Topic: Put Desktop to sleep from Laptop
Replies: 5
Views: 12664

Put Desktop to sleep from Laptop

Put Desktop to sleep from Laptop Good afternoon, I have managed to investigate, acquire, and adapt a script to wake-up my Desktop computer from my Laptop computer. My Desktop computer has a shared internal HDD and a shared USB connected HDD which are both available from my Laptop when I wake-up my D...
by PAB
24 Feb 2025 06:37
Forum: DOS Batch Forum
Topic: [SOLVED] Batch Script ignores folders with spaces
Replies: 8
Views: 11270

Re: [SOLVED] Batch Script ignores folders with spaces

Thanks for another version Lucky4Me.

Sorry I haven't replied earlier but I have been in hospital !
This being old is not all its cracked up to be !

Anyway, thank you VERY much again, it is appreciated.
by PAB
29 Jan 2025 19:10
Forum: DOS Batch Forum
Topic: [SOLVED] Batch Script ignores folders with spaces
Replies: 8
Views: 11270

Re: [SOLVED] Batch Script ignores folders with spaces

Thank you so much Lucky4Me for taking the time to help me. It is appreciated. BOTH codes work great. I will be using the 'Exclude' code as there are very few 'File Types' that are relevant to my needs. The 'Exclude' code also lists the files output in the selected directory in alphabetical order whi...
by PAB
29 Jan 2025 13:49
Forum: DOS Batch Forum
Topic: [SOLVED] Batch Script ignores folders with spaces
Replies: 8
Views: 11270

Re: [SOLVED] Batch Script ignores folders with spaces

Just one more question please if I may.

How can I get all files EXCEPT .jpg, .mp4 and .png.

Instead of . . .

Code: Select all

set "IFN=I:\Test\Paul\Paul No Way\*.*"
Or would it be something in here maybe ? . . .

Code: Select all

for %%f 
Thanks again in advance.
by PAB
28 Jan 2025 16:21
Forum: DOS Batch Forum
Topic: [SOLVED] Batch Script ignores folders with spaces
Replies: 8
Views: 11270

Re: Batch Script ignores folders with spaces

Good evening,

Can you hear that noise Lucky4Me ?
It is me slapping my weary old head.
It worked perfectly, thank you SO much.

Best Regards, Paul.
by PAB
28 Jan 2025 08:54
Forum: DOS Batch Forum
Topic: [SOLVED] Batch Script ignores folders with spaces
Replies: 8
Views: 11270

[SOLVED] Batch Script ignores folders with spaces

Good afternoon, I have this script which works great on folders that do NOT have any spaces in the filename . . . @echo off setlocal EnableDelayedExpansion set "IFN=I:\Test\Paul\Paul No Way\*.*" set "OFN=COPIED_to_SINGLE_FILE.log" if exist %OFN% (del /f /q %OFN% >nul 2>&1) echo %IFN% &:: This shows ...