Avatar of RayT
RayTFlag for United States of America

asked on 

Force Deletion Using PowerShell

How do I delete a specific sub-folder in C:\Program Files (x86) using Windows PowerShell?  I want to delete the sub-folder and ALL of the child folders/files.
PowershellWindows OS

Avatar of undefined
Last Comment
RayT
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Qlemo
Qlemo
Flag of Germany image

The double quotes need to enclose the path:
remove-item 'c:\program files (x86)\whatever' -recurse -force

Open in new window

I've also changed to ticks to prevent PowerShell from trying to accidentally detect an expression in the string.
Avatar of RayT
RayT
Flag of United States of America image

ASKER

Thanks a lot!
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo