{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1908-powershell-specialfolder-getfolderpath " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- powershellで、winodowsのSpecial folderを取得する" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## reference" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- #PSTip Working with Special Folders\n", " + https://www.powershellmagazine.com/2013/10/30/pstip-working-with-special-folders/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## log " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Desktop\n", "Programs\n", "MyDocuments\n", "Personal\n", "Favorites\n", "Startup\n", "Recent\n", "SendTo\n", "StartMenu\n", "MyMusic\n", "MyVideos\n", "DesktopDirectory\n", "MyComputer\n", "NetworkShortcuts\n", "Fonts\n", "Templates\n", "CommonStartMenu\n", "CommonPrograms\n", "CommonStartup\n", "CommonDesktopDirectory\n", "ApplicationData\n", "PrinterShortcuts\n", "LocalApplicationData\n", "InternetCache\n", "Cookies\n", "History\n", "CommonApplicationData\n", "Windows\n", "System\n", "ProgramFiles\n", "MyPictures\n", "UserProfile\n", "SystemX86\n", "ProgramFilesX86\n", "CommonProgramFiles\n", "CommonProgramFilesX86\n", "CommonTemplates\n", "CommonDocuments\n", "CommonAdminTools\n", "AdminTools\n", "CommonMusic\n", "CommonPictures\n", "CommonVideos\n", "Resources\n", "LocalizedResources\n", "CommonOemLinks\n", "CDBurning\n" ] } ], "source": [ "[Enum]::GetNames('System.Environment+SpecialFolder')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "$mydocfolder = [Environment]::GetFolderPath('MyDocuments')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "G:\\Users\\sakai\\OneDrive\\Documents\n" ] } ], "source": [ "$mydocfolder" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "System.String\n" ] } ], "source": [ "$mydocfolder.GetType().FullName" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "G:\\Users\\sakai\\AppData\\Roaming\n" ] } ], "source": [ "[Environment]::GetFolderPath('ApplicationData')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "G:\\Users\\sakai\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\n" ] } ], "source": [ "[Environment]::GetFolderPath('Startup')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "PowerShell", "language": "powershell", "name": "powershell" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".ps1", "mimetype": "text/x-sh", "name": "powershell" } }, "nbformat": 4, "nbformat_minor": 2 }