Numerous Subdirectorie's Containing Several Files With No Extension's


WyattCollins

Well-known member
Member
Local time
4:07 PM
Posts
43
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
I have a Desktop folder containing a lot of subfolder's with file's that have no extension.

Is there a single cmd command to get all of these file's in the same folder?

Also, is there a single cmd command to delete all the empty subfolder's?
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
Do you have show file extensions turned on in File Explore? As for moving them, you can't just select all files then copy and paste them? I don't like using cut and paste because if something goes wrong you can lose the files forever.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2Intel Core i7-10700K16GB (8GB PC4-19200 DDR4 SDRAM x2)NVIDIA GeForce GTX 1050 TI
    OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    PowerSpec B746
    CPU
    Intel Core i7-10700K
    Motherboard
    ASRock Z490 Phantom Gaming 4/ax
    Memory
    16GB (8GB PC4-19200 DDR4 SDRAM x2)
    Graphics Card(s)
    NVIDIA GeForce GTX 1050 TI
    Sound Card
    Realtek Audio
    Monitor(s) Displays
    #1. LG ULTRAWIDE 34" #2. AOC Q32G2WG3 32"
    Screen Resolution
    #1. 3440 X 1440 #2. 1920 x 1080
    Hard Drives
    NVMe WDC WDS100T2B0C-00PXH0 1TB
    Samsung SSD 860 EVO 1TB
    PSU
    750 Watts (62.5A)
    Case
    PowerSpec/Lian Li ATX 205
    Keyboard
    Logitech K270
    Mouse
    Logitech M185
    Browser
    Microsoft Edge and Firefox
    Antivirus
    Webroot SecureAnywhere CE 26.1
  • At a glance

    Windows 11 Canary ChannelIntel Core i5-8400 CPU @ 2.80GHz16 MB DDR 4-2666
    Operating System
    Windows 11 Canary Channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    PowerSpec G156
    CPU
    Intel Core i5-8400 CPU @ 2.80GHz
    Motherboard
    AsusTeK Prime B360M-A
    Memory
    16 MB DDR 4-2666
    Monitor(s) Displays
    23" Speptre HDMI 75Hz
    Screen Resolution
    1920x1080
    Hard Drives
    Samsung 970 EVO 500GB NVMe
    Keyboard
    Logitek K270
    Mouse
    Logitek M185
    Browser
    Firefox, Edge and Edge Canary
    Antivirus
    Windows Defender
I'm working on putting together a personal batch file for manually running in cmd.

Yep, I have the 'show file extensions' turned on.
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
I'm working on putting together a personal batch file for manually running in cmd.

Yep, I have the 'show file extensions' turned on.


To post a screenshot on this forum...​


1. Take the screenshot, edit it as desired, save to your desktop as .png or .jpg (max. size = 2MB)
2. Left click in your post, where you want to place the screenshot.
3. Click the Attach Files button at lower left, browse to your pic and click Insert.
4. After clicking Insert, I usually choose the Thumbnail option.
 

My Computers My Computers

  • At a glance

    Win 11 Home ♦♦♦26200.8655 ♦♦♦♦♦♦♦25H2AMD Ryzen 7 3700XG.Skill (F4-3200C14D-16GTZKW)EVGA RTX 2070 (08G-P4-2171-KR)
    OS
    Win 11 Home ♦♦♦26200.8655 ♦♦♦♦♦♦♦25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 5302)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Total Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • At a glance

    Windows XP Pro 32bit w/SP3AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Keyboard
    Logitech Classic Keybooard 200
    Mouse
    Logitech Optical M-BT96a
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 15 years?
The files are useless to you unless you have the right program on your computer to open that type of file. Once you identify their extension or type, install the right program on your computer to open that kind of file.

There are some free file identifier tools that let you know the extensions of the unknown file types. Some are online, some are executable. This article gives you a list and explains how to use each one. How to open file with no extension in Windows 11/10

You can use xcopy to copy files by file type from multiple folders Gather similar files from multiple folders and copy them in one simple step
You can use powershell to delete the empty folders. How to Find and Delete Empty Folders on Windows
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
This sounds like the desktop folder may be an app's cache folder. They're recognizable as really long filenames with no extensions, grouped evenly across several subfolders. If that's the case you need to identify which recent app was installed, or had its temp folders changed.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
ok...what is my post missing that causes everyone to think or believe these files are useless to me.
I know what the files are.
I use these image files on a virtual site. They are supposed to be png and jpg files.
I'm trying to put together commands as a batch file to use less time moving them into a single folder.

I dont want a GUI to do the job for me.
I want a CLI file to do this particular job in Windows...thus a batch file.
I already have it for a Linux system.

Even a dos bash converter tool or website will do.
 
Last edited:

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
MoveFiles.bat [source] [dest]

Code:
<# : batch script
@echo off
cd %~dp0
powershell -nop Invoke-Expression ('$args = @(''%*'' -split '' '')' + [System.IO.File]::ReadAllText('%~f0'))
goto :eof
#>

if ($args.Count -ne 2) {
    "Usage: MoveFiles.bat source dest"
    exit
}

if (-not (Test-Path $args[0] -PathType Container)) {
    "Source folder ""$args[0]"" is not valid."
    exit 1
}
if (-not (Test-Path $args[1] -PathType Container)) {
    "Dest folder ""$args[1]"" is not valid."
    exit 1
}

$Dest = (Get-Item $args[1]).FullName
foreach ($Filename in (Get-ChildItem $args[0] -File -Recurse).FullName) {
    try {
        Move-Item -Path $Filename -Destination $Dest -ErrorAction Stop
    }
    catch {
        'Error on "{0}": {1}' -f ($Filename -split '\\')[-1], $_.Exception.Message
    }
    $ErrorActionPreference = 'Continue'
}

Get-ChildItem $args[0] -Directory -Recurse | Remove-Item
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
There's a powershell batch script.
We're getting closer.

I'm looking for cmd command should I need to run it in safe mode.
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
Please explain something to me. How do you open the files within Windows? Windows deals with everything by file type using extensions and your files have no such designation in their current state.
I am far, far away from knowing a lot about using the command line or powershell, so I may be way wrong here. But IMO to use these tools to perform a function that deals with things at the FILE LEVEL, all the files would have to have a similarity in file names (ie: XYZ* or *XYZ) or a similarity in extention.
@Brink Do you have a solution for this poster.

EDIT: Sorry @garlin I did not see where you had addressed this poster.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
Please explain something to me. How do you open the files within Windows? Windows deals with everything by file type using extensions and your files have no such designation in their current state.
I am far, far away from knowing a lot about using the command line or powershell, so I may be way wrong here. But IMO to use these tools to perform a function that deals with things at the FILE LEVEL, all the files would have to have a similarity in file names (ie: XYZ* or *XYZ) or a similarity in extention.
@Brink Do you have a solution for this poster.

EDIT: Sorry @garlin I did not see where you had addressed this poster.
After the files are all in one location, a file extension can easily be appended to the file, thus able to work in Window's.

I have the command to add the file extension already, but that command requires the files to be in the same folder or subfolder.

You're correct in how a windows system works with files.

I'm not sure if this system will allow dual boot with linux or a linux-base.
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
I'm not sure if this system will allow dual boot with linux or a linux-base.
If Linux can easily deal with the files, you do not need to dual boot. Just boot from a Linux disto live usb and then deal with the files from within Linux. I do that all the time using Mint Cinnamon or Ubuntu when I need access to a windows drive to recover files or bypass dealing with Windows permissions. Wouldn't that work in your case?
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
I'm looking for cmd command should I need to run it in safe mode.
What do you mean by safe mode? Like a preview option?
If you want to see what it would have done, append "-WhatIf" to the end of the Move-Item line. This converts it into a non-action.

If you're more at home with POSIX shells and tools, just install Cygwin. Then you don't need Linux or dual-boot to get those advantages.
I have it on my PC.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
What do you mean by safe mode? Like a preview option?
If you want to see what it would have done, append "-WhatIf" to the end of the Move-Item line. This converts it into a non-action.

If you're more at home with POSIX shells and tools, just install Cygwin. Then you don't need Linux or dual-boot to get those advantages.
I have it on my PC.
There are times I do things in safe mode, especially in a system level only environment.
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
What do you mean by safe mode? Like a preview option?
If you want to see what it would have done, append "-WhatIf" to the end of the Move-Item line. This converts it into a non-action.

If you're more at home with POSIX shells and tools, just install Cygwin. Then you don't need Linux or dual-boot to get those advantages.
I have it on my PC.
Cygwin...is it like Wine and PlayOnLinux, etc?
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
If Linux can easily deal with the files, you do not need to dual boot. Just boot from a Linux disto live usb and then deal with the files from within Linux. I do that all the time using Mint Cinnamon or Ubuntu when I need access to a windows drive to recover files or bypass dealing with Windows permissions. Wouldn't that work in your case?
Yep...that would work.

I would approach that in a way that nobody else would...
so it would seem that is a fail-safe idea.

However, I would still seek out a command line for the cmd batch file.
 

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
here's the part of the dos batch file that I need to show...

This command works...but there are way more files like this which means a file full of these lines.
The double-colon (::) is just another way of retyping rem, short for remark.
It's comments that shouldn't be ran as a command and thus ignored by the system.
Can these lines be written as one line?

Code:
:: Move and rename files from source subdirectories and give the extension *.png to each file
move /y C:\Users\Wyatt\Desktop\Test-Dir\0b\8b\0b8bca5651664e27a343fb71586eb7f7 C:\Users\Wyatt\Desktop\Test-Dir\0b8bca5651664e27a343fb71586eb7f7.png
move /y C:\Users\Wyatt\Desktop\Test-Dir\3b\49\3b491db53fce5f9e48ffd1b4ea8f01eb C:\Users\Wyatt\Desktop\Test-Dir\3b491db53fce5f9e48ffd1b4ea8f01eb.png
move /y C:\Users\Wyatt\Desktop\Test-Dir\6a\50\6a50af3f8a6682a27083da35675f6ec5 C:\Users\Wyatt\Desktop\Test-Dir\6a50af3f8a6682a27083da35675f6ec5.png
 
Last edited:

My Computer My Computer

At a glance

Windows 11 Home 64-bit v10.0.26200 N/A Build ...Intel(R) Core(TM) i3-N305 (1.80 GHz)8.00 GB (7.70 GB usable)8.00 GB (7.70 GB usable)
OS
Windows 11 Home 64-bit v10.0.26200 N/A Build 26200
Computer type
Laptop
Manufacturer/Model
Lenovo 82XB IdeaPad Slim 3 15IAN8
CPU
Intel(R) Core(TM) i3-N305 (1.80 GHz)
Memory
8.00 GB (7.70 GB usable)
Graphics Card(s)
8.00 GB (7.70 GB usable)
Hard Drives
238 GB SSD
Mouse
ELAN touchpad; Logitech Wireless
@echo off
setlocal

set "rootFolder=C:\Users\test"

call :DeleteEmptyFolders "%rootFolder%"

echo Empty folders deleted.
pause
exit

:DeleteEmptyFolders
for /f "delims=" %%d in ('dir /ad /b "%~1" 2^>nul') do (
call :DeleteEmptyFolders "%~1\%%d"
)

for /f "delims=" %%d in ('dir /ad /b "%~1" 2^>nul') do (
rd "%~1\%%d" 2>nul
)

exit /b



Just change the 3rd line to where you want the command to start.
 

My Computer My Computer

At a glance

Windows and Mac
OS
Windows and Mac
For every smiling emoji there was a colon : and a capital D
 

My Computer My Computer

At a glance

Windows and Mac
OS
Windows and Mac
Back
Top Bottom