How To Open A File Folder

broken image


-->

Navigating through Windows PowerShell drives and manipulating the items on them is similar tomanipulating files and folders on Windows physical disk drives. This article discusses how to dealwith specific file and folder manipulation tasks using PowerShell.

To Open Folder Options in File Explorer using Keyboard Shortcut 1 Open File Explorer (Win+E). 2 Press the Alt + V keys to see the available keyboard shortcuts in the 'View' tab of the ribbon, and then press the Y and O keys. (see screenshots below). First, let's check out the preview pane in File Explorer. Open File Explorer, click on the View tab and then select Preview pane. Click on a file you wish to view, such as a Word document, Excel. Dec 31, 2020 How to open a file using cmd directly You can also choose to open files from Command Prompt on Windows 10 directly, instead of going to the folder path. You can input the full path, file name and its file extension to open the target file, e.g. 'C: Users mini Desktop travel.png'. You can also freely specify an app to open the file.

Listing All the Files and Folders Within a Folder

You can get all items directly within a folder by using Get-ChildItem. Add the optionalForce parameter to display hidden or system items. For example, this command displays the directcontents of Windows PowerShell Drive C (which is the same as the Windows physical drive C):

The command lists only the directly contained items, much like using Cmd.exe's DIR command orls in a UNIX shell. In order to show contained items, you need to specify the -Recurseparameter as well. (This can take an extremely long time to complete.) To list everything on the Cdrive:

Get-ChildItem can filter items with its Path, Filter, Include, and Excludeparameters, but those are typically based only on name. You can perform complex filtering based onother properties of items by using Where-Object.

The following command finds all executables within the Program Files folder that were last modifiedafter October 1, 2005 and which are neither smaller than 1 megabyte nor larger than 10 megabytes:

Copying Files and Folders

Copying is done with Copy-Item. The following command backs up C:boot.ini to C:boot.bak:

If the destination file already exists, the copy attempt fails. To overwrite a pre-existingdestination, use the Force parameter:

This command works even when the destination is read-only.

Folder copying works the same way. This command copies the folder C:temptest1 to the new folderC:tempDeleteMe recursively:

You can also copy a selection of items. The following command copies all .txt files containedanywhere in C:data to C:temptext:

(and

You can still use other tools to perform file system copies. XCOPY, ROBOCOPY, and COM objects, suchas the Scripting.FileSystemObject, all work in Windows PowerShell. For example, you can use theWindows Script Host Scripting.FileSystem COM class to back up C:boot.ini to C:boot.bak:

Creating Files and Folders

Creating new items works the same on all Windows PowerShell providers. If a Windows PowerShellprovider has more than one type of item—for example, the FileSystem Windows PowerShell providerdistinguishes between directories and files—you need to specify the item type.

This command creates a new folder C:tempNew Folder:

This command creates a new empty file C:tempNew Folderfile.txt

Important

When using the Force switch with the New-Item command to create a folder, and the folderalready exists, it won't overwrite or replace the folder. It will simply return the existingfolder object. However, if you use New-Item -Force on a file that already exists, the file willbe completely overwritten.

Removing All Files and Folders Within a Folder

You can remove contained items using Remove-Item, but you will be prompted to confirm theremoval if the item contains anything else. For example, if you attempt to delete the folderC:tempDeleteMe that contains other items, Windows PowerShell prompts you for confirmation beforedeleting the folder:

If you do not want to be prompted for each contained item, specify the Recurse parameter:

Mapping a Local Folder as a drive

You can also map a local folder, using the New-PSDrive command. The following command creates alocal drive P: rooted in the local Program Files directory, visible only from the PowerShellsession:

Just as with network drives, drives mapped within Windows PowerShell are immediately visible to theWindows PowerShell shell. In order to create a mapped drive visible from File Explorer, theparameter -Persist is needed. However, only remote paths can be used with Persist.

Reading a Text File into an Array

One of the more common storage formats for text data is in a file with separate lines treated asdistinct data elements. The Get-Content cmdlet can be used to read an entire file in one step,as shown here:

How to save movie clips. Get-Content already treats the data read from the file as an array, with one element per line offile content. You can confirm this by checking the Length of the returned content:

This command is most useful for getting lists of information into Windows PowerShell directly. Forexample, you might store a list of computer names or IP addresses in a fileC:tempdomainMembers.txt, with one name on each line of the file. You can use Get-Content toretrieve the file contents and put them in the variable $Computers:

$Computers is now an array containing a computer name in each element.

-->

Note

Office 365 ProPlus is being renamed to Microsoft 365 Apps for enterprise. For more information about this change, read this blog post.

How to autotune in garageband. For a Microsoft Excel 2001 for Mac version of this article, see 259921.

Summary

This step-by-step article describes how to use the Microsoft Excel startup folders. Excel uses startup folders in two ways:

  • To load Excel workbooks at startup.
  • As a reference location for templates.

The actual startup folder locations vary, depending on which version of Excel you use.

Folders that Excel uses at startup

If you install Excel in the default location, Excel opens files from the following paths:

  • In Microsoft Office Excel 2003, the path is C:Program FilesMicrosoft OfficeOffice11Xlstart

    In Microsoft Office Excel 2007, the path is C:Program FilesMicrosoft OfficeOffice12Xlstart

  • C:Documents and SettingsUser_nameApplication DataMicrosoftExcelXLSTART

    In this path, User_name is your logon user name.

  • The folder that is specified in the At startup, open all files in box.

    Note

    • To find the At startup, open all files in box in Excel 2003, click Options on the Toolsmenu, and then click the General tab. How to download pokemon games on pc.

    • To find the At startup, open all files in box in Excel 2007, click the Microsoft Office Button, click Excel Options, and then click Advanced. The At startup, open all files in box is under General.

Accepted file types during Excel startup

You typically use startup folders to load Excel templates and add-ins. You can also use startup folders to load workbooks. When you load the following types of files from a startup folder, the files have the important characteristics that are described in the following list.

Templates

If you save a workbook named Book.xlt, and then put it in a startup folder location, that workbook is the default workbook when you start Excel or open a new workbook.

To use additional templates, you must save them in the following folder:

C:Program FilesMicrosoft OfficeTemplates1033

To use the templates in Excel 2003, follow these steps:

  1. On the Filemenu, click New.
  2. In the New Workbook task pane, click On my computer under Templates.
  3. In the Templates dialog box, double-click the template for the type of workbook that you want to create on the Spreadsheet Solutions tab.

To use the templates in Excel 2007, follow these steps:

  1. Click the Microsoft Office Button, and then click New.
  2. Under Templates, click Installed Templates.
  3. Under Installed Templates, click the template that you want, and then click Create.

Add-ins

Add-ins (.xla files) that you put in a startup folder do not typically appear when you start Excel. The add-ins are loaded in memory. The add-ins run any auto macros.

You can use these add-ins by whatever method the add-in provides (for example, a command on a menu or a button on a toolbar).

Workbooks

Workbooks (.xls files) that you put in a startup folder are loaded and appear when you start Excel, unless the workbook is saved in a hidden state.

For example, the personal macro workbook Personal.xls is a global macro workbook that Excel typically loads from the XLStart folder in a hidden state.

Incorrect use of the alternative startup file location

When you use the alternative startup file location, you must specify a file path where there are recognizable file types (such as templates, add-ins, and workbooks).

If Excel finds unrecognizable file types in a startup folder, you may receive an error message. The most common error message is:

Set Or Unset Read-only Attribute Of Files And Folders In ..

This file is not a recognizable format.

Use the default file location

In addition to the alternative startup file location, the default file location can be set by using the Default file location box on the General tab in the Options dialog box in Excel 2003.

The default file location differs from a startup folder. It can set the folder location that you want Excel to point to when you open or save a file by using the File menu.

Note

Command Prompt Root Folder

How to open a ws file folder

You can still use other tools to perform file system copies. XCOPY, ROBOCOPY, and COM objects, suchas the Scripting.FileSystemObject, all work in Windows PowerShell. For example, you can use theWindows Script Host Scripting.FileSystem COM class to back up C:boot.ini to C:boot.bak:

Creating Files and Folders

Creating new items works the same on all Windows PowerShell providers. If a Windows PowerShellprovider has more than one type of item—for example, the FileSystem Windows PowerShell providerdistinguishes between directories and files—you need to specify the item type.

This command creates a new folder C:tempNew Folder:

This command creates a new empty file C:tempNew Folderfile.txt

Important

When using the Force switch with the New-Item command to create a folder, and the folderalready exists, it won't overwrite or replace the folder. It will simply return the existingfolder object. However, if you use New-Item -Force on a file that already exists, the file willbe completely overwritten.

Removing All Files and Folders Within a Folder

You can remove contained items using Remove-Item, but you will be prompted to confirm theremoval if the item contains anything else. For example, if you attempt to delete the folderC:tempDeleteMe that contains other items, Windows PowerShell prompts you for confirmation beforedeleting the folder:

If you do not want to be prompted for each contained item, specify the Recurse parameter:

Mapping a Local Folder as a drive

You can also map a local folder, using the New-PSDrive command. The following command creates alocal drive P: rooted in the local Program Files directory, visible only from the PowerShellsession:

Just as with network drives, drives mapped within Windows PowerShell are immediately visible to theWindows PowerShell shell. In order to create a mapped drive visible from File Explorer, theparameter -Persist is needed. However, only remote paths can be used with Persist.

Reading a Text File into an Array

One of the more common storage formats for text data is in a file with separate lines treated asdistinct data elements. The Get-Content cmdlet can be used to read an entire file in one step,as shown here:

How to save movie clips. Get-Content already treats the data read from the file as an array, with one element per line offile content. You can confirm this by checking the Length of the returned content:

This command is most useful for getting lists of information into Windows PowerShell directly. Forexample, you might store a list of computer names or IP addresses in a fileC:tempdomainMembers.txt, with one name on each line of the file. You can use Get-Content toretrieve the file contents and put them in the variable $Computers:

$Computers is now an array containing a computer name in each element.

-->

Note

Office 365 ProPlus is being renamed to Microsoft 365 Apps for enterprise. For more information about this change, read this blog post.

How to autotune in garageband. For a Microsoft Excel 2001 for Mac version of this article, see 259921.

Summary

This step-by-step article describes how to use the Microsoft Excel startup folders. Excel uses startup folders in two ways:

  • To load Excel workbooks at startup.
  • As a reference location for templates.

The actual startup folder locations vary, depending on which version of Excel you use.

Folders that Excel uses at startup

If you install Excel in the default location, Excel opens files from the following paths:

  • In Microsoft Office Excel 2003, the path is C:Program FilesMicrosoft OfficeOffice11Xlstart

    In Microsoft Office Excel 2007, the path is C:Program FilesMicrosoft OfficeOffice12Xlstart

  • C:Documents and SettingsUser_nameApplication DataMicrosoftExcelXLSTART

    In this path, User_name is your logon user name.

  • The folder that is specified in the At startup, open all files in box.

    Note

    • To find the At startup, open all files in box in Excel 2003, click Options on the Toolsmenu, and then click the General tab. How to download pokemon games on pc.

    • To find the At startup, open all files in box in Excel 2007, click the Microsoft Office Button, click Excel Options, and then click Advanced. The At startup, open all files in box is under General.

Accepted file types during Excel startup

You typically use startup folders to load Excel templates and add-ins. You can also use startup folders to load workbooks. When you load the following types of files from a startup folder, the files have the important characteristics that are described in the following list.

Templates

If you save a workbook named Book.xlt, and then put it in a startup folder location, that workbook is the default workbook when you start Excel or open a new workbook.

To use additional templates, you must save them in the following folder:

C:Program FilesMicrosoft OfficeTemplates1033

To use the templates in Excel 2003, follow these steps:

  1. On the Filemenu, click New.
  2. In the New Workbook task pane, click On my computer under Templates.
  3. In the Templates dialog box, double-click the template for the type of workbook that you want to create on the Spreadsheet Solutions tab.

To use the templates in Excel 2007, follow these steps:

  1. Click the Microsoft Office Button, and then click New.
  2. Under Templates, click Installed Templates.
  3. Under Installed Templates, click the template that you want, and then click Create.

Add-ins

Add-ins (.xla files) that you put in a startup folder do not typically appear when you start Excel. The add-ins are loaded in memory. The add-ins run any auto macros.

You can use these add-ins by whatever method the add-in provides (for example, a command on a menu or a button on a toolbar).

Workbooks

Workbooks (.xls files) that you put in a startup folder are loaded and appear when you start Excel, unless the workbook is saved in a hidden state.

For example, the personal macro workbook Personal.xls is a global macro workbook that Excel typically loads from the XLStart folder in a hidden state.

Incorrect use of the alternative startup file location

When you use the alternative startup file location, you must specify a file path where there are recognizable file types (such as templates, add-ins, and workbooks).

If Excel finds unrecognizable file types in a startup folder, you may receive an error message. The most common error message is:

Set Or Unset Read-only Attribute Of Files And Folders In ..

This file is not a recognizable format.

Use the default file location

In addition to the alternative startup file location, the default file location can be set by using the Default file location box on the General tab in the Options dialog box in Excel 2003.

The default file location differs from a startup folder. It can set the folder location that you want Excel to point to when you open or save a file by using the File menu.

Note

Command Prompt Root Folder

In Excel 2007, to see the default file location, follow these steps:

How To Open A File Folder In Windows 10

  1. Click the Microsoft Office Button, and then click Excel Options.
  2. Click Save.
  3. The Default file location box is under Save workbooks.




broken image