For example, if you want to create a file on the Desktop, type cd desktop and press Enter. If the directory you’re looking for isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, if you want to create a file on the Desktop, type cd desktop and press Enter. If the directory you’re looking for isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
Type type nul > filename. txt. Replace filename. txt with whatever you want to call your new file. The “. txt” part indicates that this is a plain text file. Other common file extensions include “. docx” (Word document), “. png” (empty photo),and “. rtf” (rich text document). All of these file types can be read on any Windows computer without installing additional software. Press Enter.
Type copy con testfile. txt, but replace testfile with the desired file name. [4] X Research source Press Enter. Type some text. This is a rudimentary text editor, but it’s good for quick notes or code. You can use the Enter key to go to the next line. Press Control + Z when you’re finished editing the file. Press the Enter key. You’ll see “1 file(s) copied,” which means your file is now saved with the name you created. Another way to do this is to run this command: echo enter your text here > filename. txt.
fsutil file createnew filename. txt 1000. Replace filename with the desired file name, and 1000 with the actual number of bytes you’d like the file to be.
For example, if you want to delete a file from the Desktop, type cd desktop and press Enter. If the directory you want to view isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, if you want to delete a file from the Desktop, type cd desktop and press Enter. If the directory you want to view isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
Using Command Prompt to delete files results in the files being deleted permanently rather than being moved to the Recycle Bin. Exercise caution when deleting files via Command Prompt.
For example, to delete a text file entitled “hello”, you would type del hello. txt into Command Prompt. If the file’s name has a space in it (e. g. , “hi there”), you will place the file’s name in quotations (e. g. , del “hi there”). If you get an error that says the file cannot be deleted, try using del /f filename instead, as this force-deletes read-only files.
For example, if you want to create a directory on your Desktop, you would type in cd desktop and press Enter. If the directory you’re looking for isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, if you want to create a directory on your Desktop, you would type in cd desktop and press Enter. If the directory you’re looking for isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, to make a directory named “Homework”, you would type mkdir Homework.
For example, if you want to delete a directory from your Desktop, type cd desktop. If the directory isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, if you want to delete a directory from your Desktop, type cd desktop. If the directory isn’t in your user directory (e. g. , C:\Users\YourName), you’ll have to type in the whole path (e. g. , C:\Users\SomeoneElse\Desktop\Files).
For example, if you’re trying to delete your “Homework” folder, you’d type in rmdir /s Homework here. If the directory’s name has a space in it (e. g. , “Homework assignments”), place the name in quotations (e. g. , rmdir /s “Homework assignments”).
If you try to delete a directory that contains hidden files or directories, you’ll see an error that says “The directory is not empty. " In this case, you’ll have to remove the “hidden” and “system” attributes from the files inside the directory. To do this:[14] X Research source Use cd to change into the directory you want to delete. Run dir /a to view a list of all files in the directory and their attributes. If you’re still okay with deleting all of the files in the directory, run attrib -hs *. This removes special permissions from the undeletable files. Type cd . . and press Enter to go back one directory. Run the rmdir /s command again to delete the folder.