Managing Windows Files

August 4th, 2020

Photo by Mike on Pexels.com

There are two ways to manage your files in Windows. Some of the things we have to discuss are:

  1. The command line interface and the graphical user interface.
  2. The file system has rules and a syntax that has to be followed.
  3. There are many different ways for a file to be created.
  4. There are also different file types (user vs system files).
  5. Permissions are associated with each file.
  6. Folders also have a set of options.
  7. Each file has a set of attributes that they are associated with.
  8. There are many commands with the command line to do different functions in the file system.

Windows uses a hierarchical organization model for all objects. File Explorer is the graphical user interface for that model in Windows 10 and 8.1. It was Windows Explorer in Windows 7. Windows 8.1 and 10 have a ribbon that is across the top of the window that changes contextually. Think of the bar with all the options in Microsoft Word that changes when different parts of the document is selected. “This PC” is the folder that replaced Computer in Windows 8.1 and 10. Another thing that Windows 8.1, and was carried on to Windows 10, is OneDrive in File Explorer. One thing that was liked in Windows 7 but was hidden in 8.1 and 10 is Libraries which included Music, Documents, Pictures, and Videos. Windows 8.1 uses a user favorites instead of libraries. Windows 10 uses quick access. Libraries are still in Windows 8.1 and 10.

Windows uses a hierarchical arrangement. It starts with the root directory with \ representing the root with the drive letter followed by a colon. By default, Windows chooses C as the drive letter so your root would be C:\. Windows, Program Files, and Users are some of the folders or directories in the root. Folders can be created directly under the root or you can create folders inside of folders which is called sub-folders. There are rules to what the name of a folder can be. No two sub-folders within the same folder can have the same name. Folder names cannot contain any of these reserved characters: \/:*?”<>|. These characters are used within the file system to navigate and structure the files. The full file path cannot exceed 260 characters. This includes the letter drive, root, and sub folders, and the file name including the file extension.

Files are just containers for data. There are two types of data: text and binary. Text is human readable data and binary data can only be interpreted by an application with that specific file type. File extensions are just what tells the operation system what program to open that file with.

System files are files that are protected by the operating system. They use the system attribute to indicate that they are system files. By going to control panel, selecting File Explorer options, selecting the view tab, and unselecting hide protected operating system files will show the protected system files. Most end users, and even most techs, do not need to see them.

Folder options can be used to set what happens in File Explorer. There are a few ways to get to these options. You can navigate to the control panel, change view to large icons and select folder options or file explorer options depending on the version of Windows that you are on. In Windows 8.1 and 10, you can open File Explorer, navigate to the view panel, and select options. In here you can change what is shown in File Explorer, how the search operates, and how File Explorer operates. This is where you can hide and show system files, show hidden files and folders, and hide or show file extensions. These are called file attributes.

File attributes are some what different from file system to file system. Most file systems use read, archive, system, and hidden. This can be remembered as “Every file can have a R.A.S.H”. The read attribute makes the file a read-only file so that nothing can be written to the file. The archive attribute marks the file to be archived for the next backup. The system attribute, as we already talked about, protects the file and hides it in File Explorer. The hidden attribute is exactly what it sounds like; it hides the file. The file system that Windows uses is NTFS. NTFS has what they call extended attributes. Some of the extended attributes are index, encryption, and compression.

Each folder and file can have the permissions set. This is an access control mechanism that defines what actions users can preform in or on that folder or file. To view permissions, you right click on the folder or file, select properties, and navigate to the security tab. Each user or group can have its own permissions. These controls include read, write, read and execute, modify, full control. Read means that the user can only read the file and can do nothing else with it. Write means that the user can only write to the file and not read it or edit it in any way. Read and execute would be that the user could only read and execute the file but not edit it in any way, including delete it. Modify would allow the user to be able to do most actions except change it’s permissions or it’s owner.

The command prompt can also be used to manage files in Windows. Command prompt comes in two “flavors”. There is the standard command prompt and administrator command prompt. There are a few ways to open command prompt. You can right click on the start button and select it from the menu; you can search for it in the instant search, and selecting the start menu, navigating to the Windows System folder and selecting it from there. You can also run it from the run line by pressing windowskey+r and typing cmd.exe and hitting enter. To run it as administrator, you can right click on the command prompt before launching it and select run as administrator. Alternatively, you can hold control+shift on the keyboard while you launch it. The main difference between the two is from where they run from. The standard command prompt runs from C:\Users\(whatever the username is). Command prompt runs from C:\Windows\System32. By Administrator command prompt running from there, makes it allowed to preform all tasks without having to trigger the user account control. the root directory is the drive letter followed by a colon and a greater than sign. An easy way to think of directories is to think folder. The text at the beginning of each command line is the current directory. Also if the file or directory has a space in it then you have to use double quotes around the path. Some of the commands that you can use are:

  • Enter drive letter and colon to change to that drive
  • cd means change directories
    • cd C:\Users will put you in the directory
    • You can use relative path while you are inside a directory you can just type the next directory to go into
  • dir will list everything in the current directory
    • You can also specify a location and dir and it will show the directories in that location without navigating there.
  • Wild cards (*) can be used to search
    • dir *.exe would search the current directory for any file that has a .exe file extension
    • dir let*.exe would search the current directory for any file that starts with let and has a .exe file extension
    • dir *. would search for anything without a file extension such as directories
    • dir let*.exe /s searches the current directory and all subdirectories
  • copy, xcopy, robocopy
    • copy (source) (destination)
    • xcopy
      • /S copies all directories/subdirectories except empty ones
      • /E copies all directories and subdirectories, including empty ones
      • /R overwrites read-only files
      • /O copies file ownership and ACL information (administrative privileges needed)
      • /D:m-d-y copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
    • robocopy is robust file copy for Windows
    • ren will rename a file or directory
      • c:\windows>ren testfolder newfolder will change the name of the directory of testfolder to newfolder
    • del will delete files
      • /p will prompt to delete for each file
      • /f will suppress prompt for read-only files
      • /q will suppress prompt on wildcard delete
      • /s will delete files from subdirectories
    • md or mkdir will make a new directory
    • rd will remove directory
  • Always remember that if you type a command followed by /? command prompt will give you an overview of that command

2 thoughts on “Managing Windows Files

Leave a comment