Where is the Documents Folder?

General News

Summary

In this article, our guest blogger—Brent Challis—provides a different approach to retrieving the correct Documents folder. One of the problems working with multiple computers is that the Documents folder path could be: There are many other folders that could have a range of locations based on the operating system installation; this makes writing portable code difficult, as hard-coding paths will inevitably cause problems. There is a very straightforward way to retrieve the actual path by using the .NET Environment class: I have written a PowerShell command to make working with these folders easier. This means that I can create a new object simply by calling the constructor: One of the quirky parts of the system is that I have to use the ‘MyDocuments’ key as there are two Documents folders. For me, PowerShell has two defining attributes: • It lets you develop code to achieve the needed management outcomes, such as provisioning infrastructure or pre-processing data easily and repeatably.

Classifications

industries
No industries detected
applications
Anti Piracy

AskAI Classifications

Labels
Software Development Scripting Tools PowerShell Tools

Linked Companies