Im new to cmd, and I was given a task to delete a directory, without deleting its content, in one line.
How can I do that?
I had already tried rmdir and del, but they remove the content of the directory along with it.
I thought about using move first in order to move the content, but I have no idea as for how to do it along with deleting the folder in one line.
Any help would be much appreciated
how to delete a directory in cmd, without deleting its content?
255 Views Asked by Castleking1810 At
1
There are 1 best solutions below
Related Questions in CMD
- Set req query output to a variable
- 'No such file or directory' installing RTC-Tools through pip
- Merge all *csv and remove duplicate headers using command prompt except top row
- Trying to launch batch file from powershell, and immediately closes
- How to export CMD output to a text file in C# after all the text printing on the CMD window is done?
- 'pip install mariadb' states that it cannot find include file 'mysql.h' on my Windows 10 dekstop
- Python Console commands
- How use subprocess.run with cmd external program in phython
- How do I restart a batch file in PowerShell?
- execute cmd commands as admin with java code
- PostgreSQL 16 database will not run as service, must have a CMD open for it to work
- How can I unload Visual Studio projects via batch file/developer command prompt?
- Connect to a specific country using Psiphon vpn from Command line
- How do I run multiple instances of my Powershell function in parallel?
- cmd command through powershell fails with error "The string is missing the terminator: '."
Related Questions in DEL
- Pytest/Mock keeping around extra object references in case of caught exceptions
- More Pythonic Code for Dictionary Deletions
- Issue deleting a file in remote path via ssh
- Deleting elements from numpy array is altering original list
- python del keyword doesn't work on numpy arrays
- I challenge you to find a reasonable-ish use case for `del` before function return
- How to delete/unload all modules mentioned in a list=
- Workaround for calling `open()` in `__del__()` for a function decorator
- Can a python class contain a method to delete itslef?
- IndexError: list assignment index out of range, deletion
- How I can delete a specific variable names in Python?
- Why is `__del__` method not called if an instance is stored?
- Why doesn't psutil accurately represent available memory after deleting a class instance in Python?
- I am running putty.bat file. Inside bat file I am writing del command to remove unnnecessary files which part of putty needs to be deleted
- Removing items from dictionaries using del keyword
Related Questions in RMDIR
- Pytest is stopping with no results and Test results shows FileNotFoundError
- Error: ENOTEMPTY: directory not empty, rmdir when I use fs.rmSync on a folder with nested folders
- rd, rmdir, del what to use
- Delete Folders on Remote PC with Certain names
- How to delete a non-empty folder in Batch script?
- Behavior of opendir() after removing a directory with rmdir()
- Error removing directory which is not empty
- Is there a way to delete a folder that contains only one specific file with batch?
- Window Batch file to keep some specific folders and delete the rest
- Cannot delete a sub-sub....-sub folder while trying to delete a git repository in a git repository
- Cannot delete folder using with rmdir function
- rmdir command working on linux and windows
- Recursive delete function doesn't delete folders with curly brackets in the name
- RMDIR does not delete nested directories path greater than 255 length
- PHP - Deleting folders won't work on some cases
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As answered here.
So you can easily move, then delete the folder all in one line.